Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

int av_seek_frame ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 

Seeks to the keyframe at timestamp. 'timestamp' in 'stream_index'.

stream_index If stream_index is (-1), a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base.
timestamp Timestamp in AVStream.time_base units or, if no stream is specified, in AV_TIME_BASE units.
flags flags which select direction and seeking mode
>= 0 on success

Definition at line 1648 of file utils.c.

References av_rescale(), av_seek_frame_binary(), AVRational::den, ff_read_frame_flush(), AVFormatContext::iformat, AVRational::num, AVFormatContext::streams, and AVStream::time_base.

Referenced by avformat_seek_file().

    int ret;
    AVStream *st;


    if(flags & AVSEEK_FLAG_BYTE)
        return av_seek_frame_byte(s, stream_index, timestamp, flags);

    if(stream_index < 0){
        stream_index= av_find_default_stream_index(s);
        if(stream_index < 0)
            return -1;

        st= s->streams[stream_index];
       /* timestamp for default must be expressed in AV_TIME_BASE units */
        timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num);

    /* first, we try the format specific seek */
    if (s->iformat->read_seek)
        ret = s->iformat->read_seek(s, stream_index, timestamp, flags);
        ret = -1;
    if (ret >= 0) {
        return 0;

        return av_seek_frame_binary(s, stream_index, timestamp, flags);
        return av_seek_frame_generic(s, stream_index, timestamp, flags);

Generated by  Doxygen 1.6.0   Back to index