summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2009-04-26 23:20:30 +0200
committerJan Schmidt <thaytan@noraisin.net>2009-06-20 15:21:32 +0100
commit8bbd79496187baabe6ad754e493cb167bbc3a8dc (patch)
treebf733064a468874d94c693d662c0d1c902c3db5a /sys
parent4d69d761d24e5b8320efa680402055ec785417bf (diff)
downloadgst-plugins-bad-8bbd79496187baabe6ad754e493cb167bbc3a8dc.tar.gz
gst-plugins-bad-8bbd79496187baabe6ad754e493cb167bbc3a8dc.tar.bz2
gst-plugins-bad-8bbd79496187baabe6ad754e493cb167bbc3a8dc.zip
vdpaumpegdec: reset decoder on GST_EVENT_FLUSH_STOP
Diffstat (limited to 'sys')
-rw-r--r--sys/vdpau/gstvdpmpegdecoder.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c
index 86f65fee..42c89a32 100644
--- a/sys/vdpau/gstvdpmpegdecoder.c
+++ b/sys/vdpau/gstvdpmpegdecoder.c
@@ -467,6 +467,33 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
return ret;
}
+static gboolean
+gst_vdp_mpeg_decoder_sink_event (GstPad * pad, GstEvent * event)
+{
+ GstVdpMpegDecoder *mpeg_dec;
+ GstVdpDecoder *dec;
+ gboolean res;
+
+ mpeg_dec = GST_VDPAU_MPEG_DECODER (GST_OBJECT_PARENT (pad));
+ dec = GST_VDPAU_DECODER (mpeg_dec);
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_FLUSH_STOP:
+ {
+ GST_DEBUG_OBJECT (mpeg_dec, "flush stop");
+
+ gst_vdp_mpeg_decoder_reset (mpeg_dec);
+ res = gst_pad_push_event (dec->src, event);
+
+ break;
+ }
+ default:
+ res = gst_pad_event_default (pad, event);
+ }
+
+ return res;
+}
+
/* GObject vmethod implementations */
static void
@@ -538,6 +565,7 @@ gst_vdp_mpeg_decoder_init (GstVdpMpegDecoder * mpeg_dec,
mpeg_dec->adapter = gst_adapter_new ();
gst_pad_set_chain_function (dec->sink, gst_vdp_mpeg_decoder_chain);
+ gst_pad_set_event_function (dec->sink, gst_vdp_mpeg_decoder_sink_event);
}
static void