summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-07-10 13:46:25 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-07-11 10:40:14 +0200
commit03e85bbc0f0bd19b9c6ccd711d299a9c33afbe67 (patch)
tree70b279d43bab92b70a34db88e58f6720abc8ff3b
parent6970dc127764129a6bcb06fcceb600e057346796 (diff)
vaapidecode: call purge at flush()
Calling flush() vmethod means "to flush all remaining data from the decoder without pushing it downstream". Nonetheless flush() is calling gst_vaapidecode_internal_flush(), which calls gst_video_decoder_have_frame() if there is still something in the input adapter, which may push buffers to downstream by calling handle_frame(). This patch changes this behavior by calling gst_vaapidecode_purge() rather than gst_vaapidecode_internal_flush(), which does what we want: flushes the VA decoder and releases all the rest of decoded frames. https://bugzilla.gnome.org/show_bug.cgi?id=768652
-rw-r--r--gst/vaapi/gstvaapidecode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index 2cc8c478..2d3a558d 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -1001,9 +1001,13 @@ gst_vaapidecode_flush (GstVideoDecoder * vdec)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
- if (decode->decoder && !gst_vaapidecode_internal_flush (vdec))
+ if (!decode->decoder)
return FALSE;
+ GST_LOG_OBJECT (vdec, "flushing");
+
+ gst_vaapidecode_purge (decode);
+
/* There could be issues if we avoid the reset_full() while doing
* seeking: we have to reset the internal state */
return gst_vaapidecode_reset_full (decode, decode->sinkpad_caps, TRUE);