summaryrefslogtreecommitdiffstats
path: root/media/libyuv/make_mjpeg_printfs_optional.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /media/libyuv/make_mjpeg_printfs_optional.patch
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'media/libyuv/make_mjpeg_printfs_optional.patch')
-rw-r--r--media/libyuv/make_mjpeg_printfs_optional.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/media/libyuv/make_mjpeg_printfs_optional.patch b/media/libyuv/make_mjpeg_printfs_optional.patch
new file mode 100644
index 0000000000..649bbec545
--- /dev/null
+++ b/media/libyuv/make_mjpeg_printfs_optional.patch
@@ -0,0 +1,52 @@
+# HG changeset patch
+# User Randell Jesup <rjesup@jesup.org>
+# Parent 5d4d728adccff4539e44f697b8011fb2eb1a1ad5
+
+diff --git a/source/mjpeg_decoder.cc b/source/mjpeg_decoder.cc
+--- a/source/mjpeg_decoder.cc
++++ b/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();