Bug 516847 - liboggz calculates granulepos incorrectly for duplicate Theora frames. r=chris.double
authorMatthew Gregan <kinetik@flim.org>
Tue, 22 Sep 2009 12:00:52 +1200
changeset 32931 30dc0db2b1364a1d8b47d14e41495a975276192b
parent 32930 fbf180e8af9c29e4fa42a221ffb626d81dc6510d
child 32932 52f06b726ca5439973436f9f00414bce5ff943d2
push id9241
push usermgregan@mozilla.com
push dateTue, 22 Sep 2009 05:51:11 +0000
treeherdermozilla-central@06c77b52f492 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschris.double
bugs516847
milestone1.9.3a1pre
Bug 516847 - liboggz calculates granulepos incorrectly for duplicate Theora frames. r=chris.double
media/liboggz/README_MOZILLA
media/liboggz/bug516847.patch
media/liboggz/src/liboggz/oggz_auto.c
media/liboggz/update.sh
--- a/media/liboggz/README_MOZILLA
+++ b/media/liboggz/README_MOZILLA
@@ -16,8 +16,9 @@ key_frame_seek.patch fixes bug 463358.
 offset_next.patch fixes bug 495366.
 
 bug487519.patch: Fix for bug 487519.
 
 bug496063.patch: Fix for infinite loop during seek while shutting down.
 
 faster_seek.patch: Fix for bug 501031, make seeking faster over HTTP.
 
+bug516847.patch: Fix for bug 516847 (duplicate frame handling).
new file mode 100644
--- /dev/null
+++ b/media/liboggz/bug516847.patch
@@ -0,0 +1,22 @@
+diff --git a/media/liboggz/src/liboggz/oggz_auto.c b/media/liboggz/src/liboggz/oggz_auto.c
+--- a/media/liboggz/src/liboggz/oggz_auto.c
++++ b/media/liboggz/src/liboggz/oggz_auto.c
+@@ -559,17 +559,17 @@ typedef struct {
+ static ogg_int64_t
+ auto_calc_theora(ogg_int64_t now, oggz_stream_t *stream, ogg_packet *op) {
+ 
+   long keyframe_no;
+   int keyframe_shift;
+   unsigned char first_byte;
+   auto_calc_theora_info_t *info;
+ 
+-  first_byte = op->packet[0];
++  first_byte = op->bytes == 0 ? 0x40 : op->packet[0];
+ 
+   info = (auto_calc_theora_info_t *)stream->calculate_data;
+ 
+   /* header packet */
+   if (first_byte & 0x80)
+   {
+     if (info == NULL) {
+       stream->calculate_data = oggz_malloc(sizeof(auto_calc_theora_info_t));
--- a/media/liboggz/src/liboggz/oggz_auto.c
+++ b/media/liboggz/src/liboggz/oggz_auto.c
@@ -563,17 +563,17 @@ typedef struct {
 static ogg_int64_t
 auto_calc_theora(ogg_int64_t now, oggz_stream_t *stream, ogg_packet *op) {
 
   long keyframe_no;
   int keyframe_shift;
   unsigned char first_byte;
   auto_calc_theora_info_t *info;
 
-  first_byte = op->packet[0];
+  first_byte = op->bytes == 0 ? 0x40 : op->packet[0];
 
   info = (auto_calc_theora_info_t *)stream->calculate_data;
 
   /* header packet */
   if (first_byte & 0x80)
   {
     if (info == NULL) {
       stream->calculate_data = oggz_malloc(sizeof(auto_calc_theora_info_t));
--- a/media/liboggz/update.sh
+++ b/media/liboggz/update.sh
@@ -51,8 +51,9 @@ cp $1/src/liboggz/dirac.c ./src/liboggz/
 cp $1/AUTHORS ./AUTHORS
 patch -p3 <wince.patch
 patch -p3 <endian.patch
 patch -p3 <key_frame_seek.patch
 patch -p3 <offset_next.patch
 patch -p3 <bug487519.patch
 patch -p3 <bug496063.patch
 patch -p3 <faster_seek.patch
+patch -p3 <bug516847.patch