drop incoming buffers giving errors

Original commit message from CVS:
drop incoming buffers giving errors
parent 71f892d3
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):
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment