[FFmpeg-devel] [PATCH] avformat/mov.c: mov_read_seek update cur_dts

Yvan LABADIE ylabadie
Thu Jul 1 14:57:22 CEST 2010


when using av_seek_frame() on mp4, m4a... file, AVFormatContext->cur_dts is not updated.


---
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 99cbbfb..049aed1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2536,6 +2536,7 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti

      /* adjust seek timestamp to found sample timestamp */
      seek_timestamp = st->index_entries[sample].timestamp;
+    av_update_cur_dts(s, st, seek_timestamp);

      for (i = 0; i < s->nb_streams; i++) {
          st = s->streams[i];
@@ -2543,6 +2544,7 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
              continue;

          timestamp = av_rescale_q(seek_timestamp, s->streams[stream_index]->time_base, st->time_base);
+        av_update_cur_dts(s, st, seek_timestamp);
          mov_seek_stream(s, st, timestamp, flags);
      }
      return 0;



More information about the ffmpeg-devel mailing list