From 119afdde2a4ec14cd100bf286a16a5b644f7ebbd Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Sat, 8 Jun 2019 12:15:56 +0530 Subject: [PATCH] cdg: cdgdec: reset interpreter when flushing Prevent visual artifacts from the previous position when seeking to a not keyframe. Dumping cdg_renderer version as we need the new reset API. --- gst-plugin-cdg/Cargo.toml | 2 +- gst-plugin-cdg/src/cdgdec.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gst-plugin-cdg/Cargo.toml b/gst-plugin-cdg/Cargo.toml index 69ff5d4f..2d22589f 100644 --- a/gst-plugin-cdg/Cargo.toml +++ b/gst-plugin-cdg/Cargo.toml @@ -14,7 +14,7 @@ gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] } gstreamer-app = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } cdg = "0.1" -cdg_renderer = "0.3" +cdg_renderer = "0.4" image = "0.22" muldiv = "0.2" lazy_static = "1.0" diff --git a/gst-plugin-cdg/src/cdgdec.rs b/gst-plugin-cdg/src/cdgdec.rs index c1abb7b8..477d5c0e 100644 --- a/gst-plugin-cdg/src/cdgdec.rs +++ b/gst-plugin-cdg/src/cdgdec.rs @@ -214,6 +214,14 @@ impl VideoDecoderImpl for CdgDec { self.parent_decide_allocation(element, query) } + + fn flush(&self, element: &gst_video::VideoDecoder) -> bool { + gst_debug!(CAT, obj: element, "flushing, reset CDG interpreter"); + + let mut cdg_inter = self.cdg_inter.lock().unwrap(); + cdg_inter.reset(false); + true + } } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {