changeset 2320:e33a7c4d1bd5 libavformat

ensure that the codec_id detection in av_find_stream_info() does not destroy the first dts values
author michael
date Mon, 06 Aug 2007 21:14:29 +0000
parents 4b2f8d27c8ba
children 96bab3153939
files utils.c
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Mon Aug 06 20:37:45 2007 +0000
+++ b/utils.c	Mon Aug 06 21:14:29 2007 +0000
@@ -1970,11 +1970,20 @@
 
     for(i=0;i<ic->nb_streams;i++) {
         st = ic->streams[i];
-        if (codec_identified[st->index]) {
-            av_read_frame_flush(ic);
-            av_seek_frame(ic, st->index, 0.0, 0);
-            url_fseek(&ic->pb, ic->data_offset, SEEK_SET);
+        if (codec_identified[st->index])
+            break;
+    }
+    //FIXME this is a mess
+    if(i!=ic->nb_streams){
+        av_read_frame_flush(ic);
+        for(i=0;i<ic->nb_streams;i++) {
+            st = ic->streams[i];
+            if (codec_identified[st->index]) {
+                av_seek_frame(ic, st->index, 0.0, 0);
+            }
+            st->cur_dts= st->first_dts;
         }
+        url_fseek(&ic->pb, ic->data_offset, SEEK_SET);
     }
 
 #if 0