it seems ogg requires granule to be -1 on unfinished packets
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 5 Feb 2008 01:01:56 +0000 (01:01 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 5 Feb 2008 01:01:56 +0000 (01:01 +0000)
Originally committed as revision 11866 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/oggenc.c

index 1c85073..e9aaf5a 100644 (file)
@@ -51,7 +51,11 @@ static int ogg_write_page(AVFormatContext *s, const uint8_t *data, int size,
     offset_t crc_offset;
     int page_segments, i;
 
-    size = FFMIN(size, 255*255);
+    if (size >= 255*255) {
+        granule = -1;
+        size = 255*255;
+    }
+
     page_segments = FFMIN((size/255)+!!size, 255);
 
     init_checksum(s->pb, ff_crc04C11DB7_update, 0);