diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-08-16 09:50:03 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2005-08-16 09:50:03 +0000 |
commit | 3a81f04d6042b02d92f6561da620572029ba240b (patch) | |
tree | 6a5969a9fd600f6c70c14770fa54cab35616982c | |
parent | e175b7ab78e54b195cafaaef7910daa26919b467 (diff) | |
download | gst-libav-3a81f04d6042b02d92f6561da620572029ba240b.tar.gz |
ext/ffmpeg/gstffmpegdec.c: Handle return values of gst_pad_push().
Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),
(gst_ffmpegdec_sink_event), (gst_ffmpegdec_chain):
Handle return values of gst_pad_push().
-rw-r--r-- | ChangeLog | 6 | ||||
m--------- | common | 0 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegdec.c | 18 |
3 files changed, 16 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2005-08-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net> + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame), + (gst_ffmpegdec_sink_event), (gst_ffmpegdec_chain): + Handle return values of gst_pad_push(). + 2005-08-15 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps): diff --git a/common b/common -Subproject 856fbbfa88621ab67df141ead8d4d3df32c5c17 +Subproject 8ff526a316f9b576e727b8e32cba0a53cdec07a diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index af717b3..0d390ed 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -684,13 +684,13 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec) static gint gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, - guint8 * data, guint size, gint * got_data, guint64 * in_ts) + guint8 * data, guint size, gint * got_data, guint64 * in_ts, + GstFlowReturn * ret) { GstFFMpegDecClass *oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); GstBuffer *outbuf = NULL; gint have_data = 0, len = 0; - GstFlowReturn ret; ffmpegdec->context->frame_number++; @@ -762,8 +762,8 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, if (!gst_ffmpegdec_negotiate (ffmpegdec)) return -1; - if ((ret = gst_pad_alloc_buffer (ffmpegdec->srcpad, GST_BUFFER_OFFSET_NONE, fsize, GST_PAD_CAPS (ffmpegdec->srcpad), &outbuf)) != GST_FLOW_OK) - return ret; + if ((*ret = gst_pad_alloc_buffer (ffmpegdec->srcpad, GST_BUFFER_OFFSET_NONE, fsize, GST_PAD_CAPS (ffmpegdec->srcpad), &outbuf)) != GST_FLOW_OK) + return -1; /* original ffmpeg code does not handle odd sizes correctly. * This patched up version does */ @@ -888,7 +888,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, GST_TIME_FORMAT ")", GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf))); gst_buffer_set_caps (outbuf, GST_PAD_CAPS (ffmpegdec->srcpad)); - gst_pad_push (ffmpegdec->srcpad, outbuf); + *ret = gst_pad_push (ffmpegdec->srcpad, outbuf); } return len; @@ -909,8 +909,9 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event) if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) { gint have_data, len, try = 0; do { + GstFlowReturn ret; len = gst_ffmpegdec_frame (ffmpegdec, NULL, 0, &have_data, - &ffmpegdec->next_ts); + &ffmpegdec->next_ts, &ret); if (len < 0 || have_data == 0) break; } while (try++ < 10); @@ -975,6 +976,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) guint8 *bdata, *data; gint bsize, size, len, have_data; guint64 in_ts = GST_BUFFER_TIMESTAMP (inbuf); + GstFlowReturn ret = GST_FLOW_OK; if (!ffmpegdec->opened) goto not_negotiated; @@ -1033,7 +1035,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) } if ((len = gst_ffmpegdec_frame (ffmpegdec, data, size, - &have_data, &in_ts)) < 0) + &have_data, &in_ts, &ret)) < 0 || ret != GST_FLOW_OK) break; if (!ffmpegdec->pctx) { @@ -1057,7 +1059,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) } gst_buffer_unref (inbuf); - return GST_FLOW_OK; + return ret; /* ERRORS */ not_negotiated: |