From 75d9e267c62fa8830e6b12865ea1bc67cd744d15 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 7 Jul 2004 15:35:40 +0000 Subject: [PATCH] drop incoming buffers giving errors Original commit message from CVS: drop incoming buffers giving errors --- ChangeLog | 5 +++++ ext/ffmpeg/gstffmpegdec.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44dbf8e..fd8fabc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-07-07 Thomas Vander Stichele + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain): + drop incoming buffers that generate decoding errors + +2004-07-07 Thomas Vander Stichele + * ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_log_callback), (plugin_init): * ext/ffmpeg/gstffmpegcodecmap.h: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain): diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 1ea0de4..e0fd94a 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -433,9 +433,13 @@ gst_ffmpegdec_chain (GstPad * pad, GstData * _data) outbuf = gst_buffer_new_and_alloc (AVCODEC_MAX_AUDIO_FRAME_SIZE); len = avcodec_decode_audio (ffmpegdec->context, (int16_t *) GST_BUFFER_DATA (outbuf), &have_data, data, size); - if (have_data < 0) - GST_WARNING_OBJECT (ffmpegdec, "len %d, have_data: %d < 0 !", + if (have_data < 0) { + GST_WARNING_OBJECT (ffmpegdec, + "FFmpeg error: len %d, have_data: %d < 0 !", len, have_data); + gst_buffer_unref (inbuf); + return; + } if (have_data) { GST_BUFFER_SIZE (outbuf) = have_data; -- 2.7.4