drop incoming buffers giving errors

Original commit message from CVS:
drop incoming buffers giving errors
This commit is contained in:
Thomas Vander Stichele 2004-07-07 15:35:40 +00:00
parent 71f892d3de
commit 75d9e267c6
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2004-07-07 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain):
drop incoming buffers that generate decoding errors
2004-07-07 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_log_callback), (plugin_init):

View file

@ -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;