media/libyuv/make_mjpeg_printfs_optional.patch
author Brian Birtles <birtles@gmail.com>
Wed, 11 Jul 2018 16:10:02 +0900
changeset 1562548 5e43e88b7427e72d2f989f9c61d47745cdfaa5f1
parent 1508055 738b40299efa52cec742647002f4a8737c3e1397
permissions -rw-r--r--
Bug 1471814 - Add dom.animations-api.compositing.enabled pref; r?hiro, r?bz Unlike other patches in this series, compositing is not frequently used internally (e.g. by DevTools etc.) so there is no need to enable this by default for Chrome code. It turns out we have inadvertently been shipping part of this feature for some time now. The next patch in this series will add tests for that case and disable that feature. This patch merely adapts the existing tests and without affecting the surface area covered by the combination of the newly-added pref and the existing dom.animations-api.core.enabled pref.

# HG changeset patch
# User Randell Jesup <rjesup@jesup.org>
# Parent  5d4d728adccff4539e44f697b8011fb2eb1a1ad5

diff --git a/media/libyuv/libyuv/source/mjpeg_decoder.cc b/media/libyuv/libyuv/source/mjpeg_decoder.cc
--- a/media/libyuv/libyuv/source/mjpeg_decoder.cc
+++ b/media/libyuv/libyuv/source/mjpeg_decoder.cc
@@ -73,18 +73,20 @@ MJpegDecoder::MJpegDecoder()
       databuf_strides_(NULL) {
   decompress_struct_ = new jpeg_decompress_struct;
   source_mgr_ = new jpeg_source_mgr;
 #ifdef HAVE_SETJMP
   error_mgr_ = new SetJmpErrorMgr;
   decompress_struct_->err = jpeg_std_error(&error_mgr_->base);
   // Override standard exit()-based error handler.
   error_mgr_->base.error_exit = &ErrorHandler;
+#ifndef DEBUG_MJPEG
   error_mgr_->base.output_message = &OutputHandler;
 #endif
+#endif
   decompress_struct_->client_data = NULL;
   source_mgr_->init_source = &init_source;
   source_mgr_->fill_input_buffer = &fill_input_buffer;
   source_mgr_->skip_input_data = &skip_input_data;
   source_mgr_->resync_to_restart = &jpeg_resync_to_restart;
   source_mgr_->term_source = &term_source;
   jpeg_create_decompress(decompress_struct_);
   decompress_struct_->src = source_mgr_;
@@ -450,21 +452,22 @@ void ErrorHandler(j_common_ptr cinfo) {
 #endif
 
   SetJmpErrorMgr* mgr = reinterpret_cast<SetJmpErrorMgr*>(cinfo->err);
   // This rewinds the call stack to the point of the corresponding setjmp()
   // and causes it to return (for a second time) with value 1.
   longjmp(mgr->setjmp_buffer, 1);
 }
 
+#ifndef DEBUG_MJPEG
 // Suppress fprintf warnings.
 void OutputHandler(j_common_ptr cinfo) {
   (void)cinfo;
 }
-
+#endif
 #endif  // HAVE_SETJMP
 
 void MJpegDecoder::AllocOutputBuffers(int num_outbufs) {
   if (num_outbufs != num_outbufs_) {
     // We could perhaps optimize this case to resize the output buffers without
     // necessarily having to delete and recreate each one, but it's not worth
     // it.
     DestroyOutputBuffers();