[FFmpeg-cvslog] oggenc: Fix the EOS flag

Michael Niedermayer git at videolan.org
Wed May 28 22:27:36 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed May 28 10:27:40 2014 -0700| [7dba055bb0d31b2c79d9c3a66abb849a71417d3c] | committer: Martin Storsjö

oggenc: Fix the EOS flag

This corrects the bug that caused the checksums to change in
9767d7c092c890ecc5953452e8a951fd902dd67b.

It caused the EOS flag to be set incorrectly; the ogg spec does not
allow it to be set in the middle of a logical bitstream.

Signed-off-by: Andrew Kelley <superjoe30 at gmail.com>
Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/oggenc.c |    4 ++--
 tests/ref/lavf/ogg   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 97aba34..c30315a 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -401,7 +401,7 @@ static void ogg_write_pages(AVFormatContext *s, int flush)
         if (oggstream->page_count < 2 && !flush)
             break;
         ogg_write_page(s, &p->page,
-                       flush && oggstream->page_count == 1 ? 4 : 0); // eos
+                       flush == 1 && oggstream->page_count == 1 ? 4 : 0); // eos
         next = p->next;
         av_freep(&p);
         p = next;
@@ -540,7 +540,7 @@ static int ogg_write_header(AVFormatContext *s)
 
     oggstream->page.start_granule = AV_NOPTS_VALUE;
 
-    ogg_write_pages(s, 1);
+    ogg_write_pages(s, 2);
 
     return 0;
 }
diff --git a/tests/ref/lavf/ogg b/tests/ref/lavf/ogg
index ca62b26..ea827ac 100644
--- a/tests/ref/lavf/ogg
+++ b/tests/ref/lavf/ogg
@@ -1,3 +1,3 @@
-3c41e917d95f925eaa8f2e31972edcfa *./tests/data/lavf/lavf.ogg
+8ca901bc8d24b80ebe79e387e454d1e9 *./tests/data/lavf/lavf.ogg
 13476 ./tests/data/lavf/lavf.ogg
 ./tests/data/lavf/lavf.ogg CRC=0x3a1da17e



More information about the ffmpeg-cvslog mailing list