[FFmpeg-cvslog] oggdec: print a warning if the number of headers mismatch expectations.

Michael Niedermayer git at videolan.org
Tue Sep 25 15:41:55 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep 25 15:34:58 2012 +0200| [4c273eb64c1faa47ced1cfcf15a7a1af4d27dc44] | committer: Michael Niedermayer

oggdec: print a warning if the number of headers mismatch expectations.

This is based on:
	commit 7751e4693dd10ec98c20fbd9887233b575034272
	Author: Luca Barbato <lu_zero at gentoo.org>

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

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

 libavformat/oggdec.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index f565f7e..fc26314 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -600,11 +600,16 @@ static int ogg_read_header(AVFormatContext *s)
     } while (!ogg->headers);
     av_dlog(s, "found headers\n");
 
-    for (i = 0; i < ogg->nstreams; i++)
+    for (i = 0; i < ogg->nstreams; i++) {
+        struct ogg_stream *os = ogg->streams + i;
+
         if (ogg->streams[i].header < 0) {
             av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i);
             ogg->streams[i].codec = NULL;
+        } else if (os->codec && os->nb_header < os->codec->nb_header) {
+            av_log(s, AV_LOG_WARNING, "Number of headers (%d) mismatch for stream %d\n", os->nb_header, i);
         }
+    }
 
     //linear granulepos seek from end
     ogg_get_length (s);



More information about the ffmpeg-cvslog mailing list