summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2013-03-31 18:29:07 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-03-31 18:31:37 +0200
commitc3651a79057f276f0c44f3620c23fbfed48f24b1 (patch)
treed83c4152f2ce48e39f36e7cfb0e421bdb2c31743
parentf15bc6835b2dee002340f1f67c0233e0bc6305f7 (diff)
videodecoder: always send the new buffer to parse functions
When we get a new buffer, always call the parse function, even if it is a 0 sized buffer. For theora we need to also decode 0 sized buffers. Ideally we would like to make theoradec be packetized but that fails currently because of oggdemux and because of the assumptions that the base class makes.
-rw-r--r--gst-libs/gst/video/gstvideodecoder.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
index 3017074af..08fc0bb67 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -454,7 +454,7 @@ static gboolean gst_video_decoder_propose_allocation_default (GstVideoDecoder *
decoder, GstQuery * query);
static gboolean gst_video_decoder_negotiate_default (GstVideoDecoder * decoder);
static GstFlowReturn gst_video_decoder_parse_available (GstVideoDecoder * dec,
- gboolean at_eos);
+ gboolean at_eos, gboolean new_buffer);
/* we can't use G_DEFINE_ABSTRACT_TYPE because we need the klass in the _init
* method to get to the padtemplates */
@@ -901,7 +901,8 @@ gst_video_decoder_push_event (GstVideoDecoder * decoder, GstEvent * event)
}
static GstFlowReturn
-gst_video_decoder_parse_available (GstVideoDecoder * dec, gboolean at_eos)
+gst_video_decoder_parse_available (GstVideoDecoder * dec, gboolean at_eos,
+ gboolean new_buffer)
{
GstVideoDecoderClass *decoder_class = GST_VIDEO_DECODER_GET_CLASS (dec);
GstVideoDecoderPrivate *priv = dec->priv;
@@ -911,7 +912,9 @@ gst_video_decoder_parse_available (GstVideoDecoder * dec, gboolean at_eos)
available = gst_adapter_available (priv->input_adapter);
start_size = 0;
- while (ret == GST_FLOW_OK && available && start_size != available) {
+ while (ret == GST_FLOW_OK && ((available && start_size != available)
+ || new_buffer)) {
+ new_buffer = FALSE;
/* current frame may have been parsed and handled,
* so we need to set up a new one when asking subclass to parse */
if (priv->current_frame == NULL)
@@ -939,7 +942,7 @@ gst_video_decoder_drain_out (GstVideoDecoder * dec, gboolean at_eos)
/* Forward mode, if unpacketized, give the child class
* a final chance to flush out packets */
if (!priv->packetized) {
- ret = gst_video_decoder_parse_available (dec, TRUE);
+ ret = gst_video_decoder_parse_available (dec, TRUE, FALSE);
}
} else {
/* Reverse playback mode */
@@ -1737,7 +1740,7 @@ gst_video_decoder_chain_forward (GstVideoDecoder * decoder,
} else {
gst_adapter_push (priv->input_adapter, buf);
- ret = gst_video_decoder_parse_available (decoder, at_eos);
+ ret = gst_video_decoder_parse_available (decoder, at_eos, TRUE);
}
if (ret == GST_VIDEO_DECODER_FLOW_NEED_DATA)