[FFmpeg-cvslog] ffprobe: fix chapter printing, fix JSON output

Stefano Sabatini git at videolan.org
Tue May 29 18:14:41 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue May 29 18:08:00 2012 +0200| [ad381ac97fadaab681075ef9331e917683805233] | committer: Stefano Sabatini

ffprobe: fix chapter printing, fix JSON output

Make writer_print_chapter_header() set the internal values *before* the
private writer callback is called, otherwise the accessed internal values
will be wrong.

Fix regression introduced in fa6cb2fdffe.

Found-By: Daemon404

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

 ffprobe.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index 2727dd7..afc0883 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -252,14 +252,14 @@ static inline void writer_print_footer(WriterContext *wctx)
 static inline void writer_print_chapter_header(WriterContext *wctx,
                                                const char *chapter)
 {
-    if (wctx->writer->print_chapter_header)
-        wctx->writer->print_chapter_header(wctx, chapter);
     wctx->nb_section = 0;
-
     wctx->multiple_sections = !strcmp(chapter, "packets") || !strcmp(chapter, "frames" ) ||
                               !strcmp(chapter, "packets_and_frames") ||
                               !strcmp(chapter, "streams") || !strcmp(chapter, "library_versions");
     wctx->is_fmt_chapter = !strcmp(chapter, "format");
+
+    if (wctx->writer->print_chapter_header)
+        wctx->writer->print_chapter_header(wctx, chapter);
 }
 
 static inline void writer_print_chapter_footer(WriterContext *wctx,



More information about the ffmpeg-cvslog mailing list