| Index: patches/to_upstream/24_ogg_index.patch
|
| ===================================================================
|
| --- patches/to_upstream/24_ogg_index.patch (revision 0)
|
| +++ patches/to_upstream/24_ogg_index.patch (revision 0)
|
| @@ -0,0 +1,38 @@
|
| +diff -wurp -N orig/libavformat/oggdec.c ffmpeg-mt/libavformat/oggdec.c
|
| +--- orig/libavformat/oggdec.c 2011-02-25 03:23:22.663626821 -0800
|
| ++++ ffmpeg-mt/libavformat/oggdec.c 2011-02-25 07:30:11.045572658 -0800
|
| +@@ -610,10 +610,9 @@ ogg_read_timestamp (AVFormatContext * s,
|
| + int64_t pos_limit)
|
| + {
|
| + struct ogg *ogg = s->priv_data;
|
| +- struct ogg_stream *os = ogg->streams + stream_index;
|
| + ByteIOContext *bc = s->pb;
|
| + int64_t pts = AV_NOPTS_VALUE;
|
| +- int i;
|
| ++ int i = -1;
|
| + int packet = 0;
|
| + int64_t start_pos = *pos_arg;
|
| + url_fseek(bc, *pos_arg, SEEK_SET);
|
| +@@ -621,6 +620,7 @@ ogg_read_timestamp (AVFormatContext * s,
|
| +
|
| + while (url_ftell(bc) < pos_limit && !ogg_packet(s, &i, NULL, NULL, pos_arg)) {
|
| + if (i == stream_index) {
|
| ++ struct ogg_stream *os = ogg->streams + stream_index;
|
| + pts = ogg_calc_pts(s, i, NULL);
|
| + if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY))
|
| + pts = AV_NOPTS_VALUE;
|
| +@@ -655,12 +655,14 @@ static int ogg_read_seek(AVFormatContext
|
| + os->keyframe_seek = 1;
|
| +
|
| + ret = av_seek_frame_binary(s, stream_index, timestamp, flags);
|
| ++ os = ogg->streams + stream_index;
|
| + if (ret < 0)
|
| + os->keyframe_seek = 0;
|
| +
|
| + // Save the position seeked to.
|
| + pos_arg = seek_pos = url_ftell(s->pb);
|
| + seek_pts = ogg_read_timestamp(s, stream_index, &pos_arg, url_fsize(s->pb));
|
| ++ os = ogg->streams + stream_index;
|
| +
|
| + // Since we have seeked to the beginning then reset lastpts and lastdts to 0.
|
| + if (!seek_pts) {
|
|
|