ext/ffmpeg/gstffmpegdec.c: If ffmpeg reports 0 bytes of input data consumed, don't break out unless it also didn't pr...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c:
If ffmpeg reports 0 bytes of input data consumed, don't break out
unless it also didn't produce any output. Fixes the audio in #377400
and doesn't break anything else I've tested.
Enable the mp3 parser, and set mp3 and mpeg2-video decoding autoplug
at marginal level, as they seem to both work fine now.
This commit is contained in:
Jan Schmidt 2008-07-01 09:39:19 +00:00
parent bed7aa3f98
commit 17e954b034
3 changed files with 13 additions and 11 deletions

View file

@ -1,3 +1,13 @@
2008-07-01 Jan Schmidt <jan.schmidt@sun.com>
* ext/ffmpeg/gstffmpegdec.c:
If ffmpeg reports 0 bytes of input data consumed, don't break out
unless it also didn't produce any output. Fixes the audio in #377400
and doesn't break anything else I've tested.
Enable the mp3 parser, and set mp3 and mpeg2-video decoding autoplug
at marginal level, as they seem to both work fine now.
2008-06-13 Edward Hervey <edward.hervey@collabora.co.uk> 2008-06-13 Edward Hervey <edward.hervey@collabora.co.uk>
* ext/ffmpeg/gstffmpegcodecmap.c: * ext/ffmpeg/gstffmpegcodecmap.c:

2
common

@ -1 +1 @@
Subproject commit 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee8 Subproject commit d9cd98b46aebaf143dc43d8563a3bff650be6a7e

View file

@ -529,7 +529,6 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec)
switch (oclass->in_plugin->id) { switch (oclass->in_plugin->id) {
case CODEC_ID_MPEG4: case CODEC_ID_MPEG4:
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
case CODEC_ID_MP3:
case CODEC_ID_VC1: case CODEC_ID_VC1:
GST_LOG_OBJECT (ffmpegdec, "not using parser, blacklisted codec"); GST_LOG_OBJECT (ffmpegdec, "not using parser, blacklisted codec");
ffmpegdec->pctx = NULL; ffmpegdec->pctx = NULL;
@ -2245,7 +2244,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
break; break;
} }
if (!ffmpegdec->pctx) { if (!ffmpegdec->pctx) {
if (len == 0) { if (len == 0 && !have_data) {
/* nothing was decoded, this could be because no data was available or /* nothing was decoded, this could be because no data was available or
* because we were skipping frames. * because we were skipping frames.
* If we have no context we must exit and wait for more data, we keep the * If we have no context we must exit and wait for more data, we keep the
@ -2285,7 +2284,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
} while (bsize > 0); } while (bsize > 0);
/* keep left-over */ /* keep left-over */
if ((ffmpegdec->pctx || oclass->in_plugin->id == CODEC_ID_MP3) && bsize > 0) { if (ffmpegdec->pctx && bsize > 0) {
in_timestamp = GST_BUFFER_TIMESTAMP (inbuf); in_timestamp = GST_BUFFER_TIMESTAMP (inbuf);
GST_LOG_OBJECT (ffmpegdec, GST_LOG_OBJECT (ffmpegdec,
@ -2518,13 +2517,6 @@ gst_ffmpegdec_register (GstPlugin * plugin)
note: if you change this, see the code in gstdv.c in good/ext/dv. */ note: if you change this, see the code in gstdv.c in good/ext/dv. */
rank = GST_RANK_SECONDARY; rank = GST_RANK_SECONDARY;
break; break;
/* MP3 and MPEG2 have better alternatives and
the ffmpeg versions don't work properly feel
free to assign rank if you fix them */
case CODEC_ID_MP3:
case CODEC_ID_MPEG2VIDEO:
rank = GST_RANK_NONE;
break;
default: default:
rank = GST_RANK_MARGINAL; rank = GST_RANK_MARGINAL;
break; break;