GNOME Bugzilla – Bug 665566
[0.11] ffmpegdec reopens the decoder every time it receives GST_EVENT_CAPS
Last modified: 2012-02-20 15:25:09 UTC
Created attachment 202788 [details] [review] Path to only reopen the decoder when new caps are different Sometimes the pipeline is already playing when upstream element sends RECONFIGURE event which parser receives and subsequently sends another GST_EVENT_CAPS. The new CAPS event causes ffmpegdec to reopen decoder even when CAPS are same and decoding is already in progress, which can lead to decompression artifacts. The patch just checks if new caps are different than old before reopening the decoder. I'm not sure if this is the best solution, perhaps the problem should be dealt with on another level.
Just a minor correction, the reconfigure event is handled by capsfilter after parser (added by decodebin)
Created attachment 203206 [details] [review] Only reopen decoder when new caps are different I staged a chunk changing DTS rank in previous patch by accident.
Looking at the patch, it seems worthwhile to point out https://bugzilla.gnome.org/show_bug.cgi?id=663333, which may or may not apply here, since gst_caps_is_equal is now used. Otherwise, this patch seems to make sense at a first glance.
commit a079886388399ae4eb6a15b7641b4b0a6ad7dcff Author: Matej Knopp <matej.knopp@gmail.com> Date: Sun Dec 11 06:25:23 2011 +0100 only reopen decoder when new caps are different