oggenc: Fix the EOS flag
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 28 May 2014 17:27:40 +0000 (10:27 -0700)
committerMartin Storsjö <martin@martin.st>
Wed, 28 May 2014 18:51:38 +0000 (21:51 +0300)
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@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/oggenc.c
tests/ref/lavf/ogg

index 97aba34a69720d761ab66f77e23f84795be25b9f..c30315a920cfc97748a9d873e8db50b95fe5ca5e 100644 (file)
@@ -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;
 }
index ca62b2650a8c87a3b1201f948d386a8b93b7512c..ea827acd4cc28749e017f738316d433bcfac62b6 100644 (file)
@@ -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