Mercurial > libavformat.hg
comparison utils.c @ 557:084de726b4d0 libavformat
default stream timebase docs patch by (Nathan Kurz <nate at verse dot com>)
author | michael |
---|---|
date | Mon, 11 Oct 2004 19:42:18 +0000 |
parents | cb5f220888c0 |
children | 63226381e03c |
comparison
equal
deleted
inserted
replaced
556:cb5f220888c0 | 557:084de726b4d0 |
---|---|
1232 | 1232 |
1233 /** | 1233 /** |
1234 * Seek to the key frame at timestamp. | 1234 * Seek to the key frame at timestamp. |
1235 * 'timestamp' in 'stream_index'. | 1235 * 'timestamp' in 'stream_index'. |
1236 * @param stream_index If stream_index is (-1), a default | 1236 * @param stream_index If stream_index is (-1), a default |
1237 * stream is selected | 1237 * stream is selected, and timestamp is automatically converted |
1238 * from AV_TIME_BASE units to the stream specific time_base. | |
1238 * @param timestamp timestamp in AVStream.time_base units | 1239 * @param timestamp timestamp in AVStream.time_base units |
1239 * @param flags flags which select direction and seeking mode | 1240 * @param flags flags which select direction and seeking mode |
1240 * @return >= 0 on success | 1241 * @return >= 0 on success |
1241 */ | 1242 */ |
1242 int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) | 1243 int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) |
1253 stream_index= av_find_default_stream_index(s); | 1254 stream_index= av_find_default_stream_index(s); |
1254 if(stream_index < 0) | 1255 if(stream_index < 0) |
1255 return -1; | 1256 return -1; |
1256 | 1257 |
1257 st= s->streams[stream_index]; | 1258 st= s->streams[stream_index]; |
1259 /* timestamp for default must be expressed in AV_TIME_BASE units */ | |
1258 timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num); | 1260 timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num); |
1259 } | 1261 } |
1260 st= s->streams[stream_index]; | 1262 st= s->streams[stream_index]; |
1261 | 1263 |
1262 /* first, we try the format specific seek */ | 1264 /* first, we try the format specific seek */ |