[FFmpeg-cvslog] avformat: Print " Consider increasing the value for analzeduration and probesize" even more often

Carl Eugen Hoyos git at videolan.org
Tue Jul 2 15:14:16 CEST 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Jun 20 09:34:15 2013 +0200| [2492f7774f6c763b23c65d30a2eeb558ea23f4a2] | committer: Michael Niedermayer

avformat: Print "Consider increasing the value for analzeduration and probesize" even more often

The sample from ticket #2691 currently does not trigger "Consider increasing
the value for analzeduration and probesize" because the audio streams are
only added after calling estimate_timings(). Attached patch moves the message
below this function call.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2492f7774f6c763b23c65d30a2eeb558ea23f4a2
---

 libavformat/utils.c |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 67fb97c..1f59b31 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2890,7 +2890,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 
         ret = -1; /* we could not have all the codec parameters before EOF */
         for(i=0;i<ic->nb_streams;i++) {
-            const char *errmsg;
 
             st = ic->streams[i];
 
@@ -2907,17 +2906,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
                         "decoding for stream %d failed\n", st->index);
                 }
             }
-
-            if (!has_codec_parameters(st, &errmsg)) {
-                char buf[256];
-                avcodec_string(buf, sizeof(buf), st->codec, 0);
-                av_log(ic, AV_LOG_WARNING,
-                       "Could not find codec parameters for stream %d (%s): %s\n"
-                       "Consider increasing the value for the 'analyzeduration' and 'probesize' options\n",
-                       i, buf, errmsg);
-            } else {
-                ret = 0;
-            }
         }
     }
 
@@ -3027,6 +3015,21 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
     if(ic->probesize)
     estimate_timings(ic, old_offset);
 
+    for(i=0;i<ic->nb_streams;i++) {
+        const char *errmsg;
+        st = ic->streams[i];
+        if (!has_codec_parameters(st, &errmsg)) {
+            char buf[256];
+            avcodec_string(buf, sizeof(buf), st->codec, 0);
+            av_log(ic, AV_LOG_WARNING,
+                   "Could not find codec parameters for stream %d (%s): %s\n"
+                   "Consider increasing the value for the 'analyzeduration' and 'probesize' options\n",
+                   i, buf, errmsg);
+        } else {
+            ret = 0;
+        }
+    }
+
     compute_chapters_end(ic);
 
  find_stream_info_err:



More information about the ffmpeg-cvslog mailing list