Commit fa496b82 authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/gstffmpegdec.c: Next try at using pad_alloc_buffer (#300923).

Original commit message from CVS:
Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
Next try at using pad_alloc_buffer (#300923).
parent 735b7d7b
2005-04-18 Luca Ognibene <luogni@tin.it>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
Next try at using pad_alloc_buffer (#300923).
2005-04-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
......
......@@ -645,7 +645,11 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
ffmpegdec->context->width, ffmpegdec->context->height);
ffmpegdec->waiting_for_key = FALSE;
outbuf = gst_buffer_new_and_alloc (fsize);
if (!gst_ffmpegdec_negotiate (ffmpegdec))
return -1;
outbuf = gst_pad_alloc_buffer (ffmpegdec->srcpad, GST_BUFFER_OFFSET_NONE, fsize);
/* original ffmpeg code does not handle odd sizes correctly.
* This patched up version does */
......@@ -719,6 +723,12 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
"Decode audio: len=%d, have_data=%d", len, have_data);
if (len >= 0 && have_data > 0) {
if (!gst_ffmpegdec_negotiate (ffmpegdec)) {
gst_buffer_unref (outbuf);
return -1;
}
GST_BUFFER_SIZE (outbuf) = have_data;
if (GST_CLOCK_TIME_IS_VALID (*in_ts)) {
ffmpegdec->next_ts = *in_ts;
......@@ -756,11 +766,6 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
GST_DEBUG_OBJECT (ffmpegdec, "Decoded data, now pushing (%"
GST_TIME_FORMAT ")", GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)));
if (!gst_ffmpegdec_negotiate (ffmpegdec)) {
gst_buffer_unref (outbuf);
return -1;
}
if (GST_PAD_IS_USABLE (ffmpegdec->srcpad))
gst_pad_push (ffmpegdec->srcpad, GST_DATA (outbuf));
else
......
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