Bug 498815 - libtheora update - r=doublec rs=roc
authorTim Terriberry <tterribe@email.unc.edu>
Fri, 19 Jun 2009 15:11:15 +1200
changeset 29341 c5e23f5c7e7bb8bf79e2e25a4e4b0eff1cbe9b05
parent 29340 240cad5e94b690dd035e86a15f436f44f8f3f244
child 29342 e83515363df8f8ef0fc10267721a4208d71666f7
push id7586
push usercdouble@mozilla.com
push dateFri, 19 Jun 2009 06:25:19 +0000
treeherdermozilla-central@592ca0329827 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec, roc
bugs498815
milestone1.9.2a1pre
Bug 498815 - libtheora update - r=doublec rs=roc
media/libtheora/README_MOZILLA
media/libtheora/bug498815.patch
media/libtheora/lib/dec/decinfo.c
--- a/media/libtheora/README_MOZILLA
+++ b/media/libtheora/README_MOZILLA
@@ -8,8 +8,9 @@ Bug 455357 - WinCE LibTheora Pre-defined
   455357_wince_local_variable_macro_clash_patch
   This patch is needed for building WinCE / WinMobile because the 
   Mozilla WinCE Shunt Library currently includes windows.h header file,
   which causes a conflict with local variables in the oc_dering_block()
   function.  This issue should be cleared up soon, with a reworking of 
   the WinCE Shunt Library (Bug 456788 - reduce windows ce shunt impact).  
   Until then, this simple patch allows WinCE to finish compiling.
 
+bug498815.patch: Fix for this bug from libtheora svn r16143.
new file mode 100644
--- /dev/null
+++ b/media/libtheora/bug498815.patch
@@ -0,0 +1,30 @@
+Index: decinfo.c
+===================================================================
+--- decinfo.c   (revision 16127)
++++ decinfo.c   (working copy)
+@@ -70,12 +70,8 @@
+   _info->pic_height=(ogg_uint32_t)val;
+   theorapackB_read(_opb,8,&val);
+   _info->pic_x=(ogg_uint32_t)val;
+-  /*Note: The sense of pic_y is inverted in what we pass back to the
+-     application compared to how it is stored in the bitstream.
+-    This is because the bitstream uses a right-handed coordinate system, while
+-     applications expect a left-handed one.*/
+   theorapackB_read(_opb,8,&val);
+-  _info->pic_y=_info->frame_height-_info->pic_height-(ogg_uint32_t)val;
++  _info->pic_y=(ogg_uint32_t)val;
+   theorapackB_read(_opb,32,&val);
+   _info->fps_numerator=(ogg_uint32_t)val;
+   theorapackB_read(_opb,32,&val);
+@@ -86,6 +82,11 @@
+    _info->fps_numerator==0||_info->fps_denominator==0){
+     return TH_EBADHEADER;
+   }
++  /*Note: The sense of pic_y is inverted in what we pass back to the
++     application compared to how it is stored in the bitstream.
++    This is because the bitstream uses a right-handed coordinate system, while
++     applications expect a left-handed one.*/
++  _info->pic_y=_info->frame_height-_info->pic_height-_info->pic_y;
+   theorapackB_read(_opb,24,&val);
+   _info->aspect_numerator=(ogg_uint32_t)val;
+   theorapackB_read(_opb,24,&val);
--- a/media/libtheora/lib/dec/decinfo.c
+++ b/media/libtheora/lib/dec/decinfo.c
@@ -65,32 +65,33 @@ static int oc_info_unpack(oggpack_buffer
   theorapackB_read(_opb,16,&val);
   _info->frame_height=(ogg_uint32_t)val<<4;
   theorapackB_read(_opb,24,&val);
   _info->pic_width=(ogg_uint32_t)val;
   theorapackB_read(_opb,24,&val);
   _info->pic_height=(ogg_uint32_t)val;
   theorapackB_read(_opb,8,&val);
   _info->pic_x=(ogg_uint32_t)val;
-  /*Note: The sense of pic_y is inverted in what we pass back to the
-     application compared to how it is stored in the bitstream.
-    This is because the bitstream uses a right-handed coordinate system, while
-     applications expect a left-handed one.*/
   theorapackB_read(_opb,8,&val);
-  _info->pic_y=_info->frame_height-_info->pic_height-(ogg_uint32_t)val;
+  _info->pic_y=(ogg_uint32_t)val;
   theorapackB_read(_opb,32,&val);
   _info->fps_numerator=(ogg_uint32_t)val;
   theorapackB_read(_opb,32,&val);
   _info->fps_denominator=(ogg_uint32_t)val;
   if(_info->frame_width==0||_info->frame_height==0||
    _info->pic_width+_info->pic_x>_info->frame_width||
    _info->pic_height+_info->pic_y>_info->frame_height||
    _info->fps_numerator==0||_info->fps_denominator==0){
     return TH_EBADHEADER;
   }
+  /*Note: The sense of pic_y is inverted in what we pass back to the
+     application compared to how it is stored in the bitstream.
+    This is because the bitstream uses a right-handed coordinate system, while
+     applications expect a left-handed one.*/
+  _info->pic_y=_info->frame_height-_info->pic_height-_info->pic_y;
   theorapackB_read(_opb,24,&val);
   _info->aspect_numerator=(ogg_uint32_t)val;
   theorapackB_read(_opb,24,&val);
   _info->aspect_denominator=(ogg_uint32_t)val;
   theorapackB_read(_opb,8,&val);
   _info->colorspace=(th_colorspace)val;
   theorapackB_read(_opb,24,&val);
   _info->target_bitrate=(int)val;