Bug 450891 - Stop liboggz writing debug to stdout - rs=roc
authorChris Double <chris.double@double.co.nz>
Wed, 29 Oct 2008 07:55:10 +1300
changeset 21008 860d0f29f0be1bca33fa6df79386b7e76a509800
parent 21007 831818cf28652aa411c0127fad2b3a8ebdba85ee
child 21009 6704a86e66ca339f75a9f197ca80d9e3f12d6a01
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs450891
milestone1.9.1b2pre
Bug 450891 - Stop liboggz writing debug to stdout - rs=roc
media/liboggz/README_MOZILLA
media/liboggz/src/liboggz/oggz_auto.c
media/liboggz/update.sh
media/liboggz/warning.patch
--- a/media/liboggz/README_MOZILLA
+++ b/media/liboggz/README_MOZILLA
@@ -2,8 +2,13 @@ The source from this directory was copie
 source distribution using the update.sh script. The only changes made
 were those applied by update.sh, which applies a patch from
 seek.patch, and the addition/upate of Makefile.in files for the
 Mozilla build system.
 
 The seek.patch address a bug in liboggz when a seek call returns an
 error. It also addresses an issue where the guess for the seek
 position can exceed the file size. These will be upstreamed to liboggz.
+
+The warning.patch addresses a printf in liboggz that is not wrapped
+in a DEBUG #ifdef. See Mozilla bug 450891 and Annodex ticket 431:
+
+http://trac.annodex.net/ticket/431
--- a/media/liboggz/src/liboggz/oggz_auto.c
+++ b/media/liboggz/src/liboggz/oggz_auto.c
@@ -804,20 +804,22 @@ auto_calc_vorbis(ogg_int64_t now, oggz_s
         /* shift to appropriate position */
         size_check <<= (5 - offset);
         /* or in part of byte from current_pos - 1 */
         size_check |= (current_pos[-1] & ~((1 << (offset + 3)) - 1)) >> 
                 (offset + 3);
       }
       
       size_check += 1;
+#ifdef DEBUG
       if (size_check != size)
       {
         printf("WARNING: size parsing failed for VORBIS mode packets\n");
       }
+#endif
 
       /*
        * store mode size information in our info struct
        */
       stream->calculate_data = realloc(stream->calculate_data,
               sizeof(auto_calc_vorbis_info_t) + (size - 1) * sizeof(int));
       info = (auto_calc_vorbis_info_t *)(stream->calculate_data);
       
--- a/media/liboggz/update.sh
+++ b/media/liboggz/update.sh
@@ -36,9 +36,10 @@ cp $1/src/liboggz/oggz_stream_private.h 
 cp $1/src/liboggz/oggz_vector.h ./src/liboggz/oggz_vector.h
 cp $1/src/liboggz/oggz_auto.h ./src/liboggz/oggz_auto.h
 sed s/\#include\ \"config.h\"/\#ifdef\ WIN32\\n\#include\ \"config_win32.h\"\\n\#else\\n\#include\ \"config.h\"\\n\#endif/g $1/src/liboggz/oggz_io.c >./src/liboggz/oggz_io.c
 sed s/\#include\ \"config.h\"/\#ifdef\ WIN32\\n\#include\ \"config_win32.h\"\\n\#else\\n\#include\ \"config.h\"\\n\#endif/g $1/src/liboggz/oggz_vector.c >./src/liboggz/oggz_vector.c
 sed s/\#include\ \"config.h\"/\#ifdef\ WIN32\\n\#include\ \"config_win32.h\"\\n\#else\\n\#include\ \"config.h\"\\n\#endif/g $1/src/liboggz/oggz_seek.c >./src/liboggz/oggz_seek.c
 cp $1/src/liboggz/oggz_dlist.h ./src/liboggz/oggz_dlist.h
 sed s/\#include\ \"config.h\"/\#ifdef\ WIN32\\n\#include\ \"config_win32.h\"\\n\#else\\n\#include\ \"config.h\"\\n\#endif/g $1/src/liboggz/metric_internal.c >./src/liboggz/metric_internal.c
 cp $1/AUTHORS ./AUTHORS
-patch -p4 <seek.patch
\ No newline at end of file
+patch -p4 <seek.patch
+patch -p4 <warning.patch
new file mode 100644
--- /dev/null
+++ b/media/liboggz/warning.patch
@@ -0,0 +1,17 @@
+diff --git a/media/liboggz/src/liboggz/oggz_auto.c b/media/liboggz/src/liboggz/oggz_auto.c
+index 6d83fa9..95ffe6c 100644
+--- a/media/liboggz/src/liboggz/oggz_auto.c
++++ b/media/liboggz/src/liboggz/oggz_auto.c
+@@ -809,10 +809,12 @@ auto_calc_vorbis(ogg_int64_t now, oggz_stream_t *stream, ogg_packet *op) {
+       }
+       
+       size_check += 1;
++#ifdef DEBUG
+       if (size_check != size)
+       {
+         printf("WARNING: size parsing failed for VORBIS mode packets\n");
+       }
++#endif
+ 
+       /*
+        * store mode size information in our info struct