Merge branch 'master' into 0.11

Conflicts:
	ext/ffmpeg/gstffmpegdec.c
This commit is contained in:
Wim Taymans 2011-04-07 12:11:37 +02:00
commit 8faa991476

View file

@ -2472,7 +2472,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
{
GstFFMpegDec *ffmpegdec;
GstFFMpegDecClass *oclass;
guint8 *data, *bdata, *pdata;
guint8 *data, *bdata;
guint8 *odata;
gsize osize;
gint size, bsize, len, have_data;
@ -2583,7 +2583,23 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
bsize, in_offset, GST_TIME_ARGS (in_timestamp),
GST_TIME_ARGS (in_duration), in_info->idx);
if (ffmpegdec->do_padding) {
/* add padding */
if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
ffmpegdec->padded = g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
ffmpegdec->padded_size);
}
memcpy (ffmpegdec->padded, bdata, bsize);
memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
bdata = ffmpegdec->padded;
}
do {
guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
/* parse, if at all possible */
if (ffmpegdec->pctx) {
gint res;
@ -2642,26 +2658,18 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
}
if (ffmpegdec->do_padding) {
/* add padding */
if (ffmpegdec->padded_size < size + FF_INPUT_BUFFER_PADDING_SIZE) {
ffmpegdec->padded_size = size + FF_INPUT_BUFFER_PADDING_SIZE;
ffmpegdec->padded =
g_realloc (ffmpegdec->padded, ffmpegdec->padded_size);
GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
ffmpegdec->padded_size);
}
memcpy (ffmpegdec->padded, data, size);
memset (ffmpegdec->padded + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
pdata = ffmpegdec->padded;
} else {
pdata = data;
/* add temporary padding */
memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
}
/* decode a frame of audio/video now */
len =
gst_ffmpegdec_frame (ffmpegdec, pdata, size, &have_data, dec_info,
&ret);
gst_ffmpegdec_frame (ffmpegdec, data, size, &have_data, dec_info, &ret);
if (ffmpegdec->do_padding) {
memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (ret != GST_FLOW_OK) {
GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s",