matroskademux: try to ensure keyframe when seeking without index
matroskademux: try to ensure keyframe when seeking without index

When seeking in pull mode without an index (because there is no index
or the file is still being written to) we bisect to find the right
cluster to jump to. However, it's possible the cluster we found doesn't
start with a keyframe, which leads to decoding errors, so if we know
that the found cluster starts with a delta frame try to scan back to
previous clusters until we find one that starts with a keyframe or
we are back at the beginning. Theoretically it's possible that all
clusters but the first one do not start with a keyframe and the
keyframes are in the middle of clusters, but this is extremely
unusual, so we will cover this case with a basic sanity check.

This problem is especially problematic with content recorded with
dynamic GOP and FPS, where long GOP lengths and low FPS may cause a
large set of clusters to lack key frames. Playback would then be
started on a non-keyframe cluster, and the large number of such frames
would make the content impossible to decode fo a long stretch of time.

Based on patch by: Mats Lindestam <matslm@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=790696

pexip/gst-plugins-good,GStreamer/gst-plugins-good,pexip/gst-plugins-good,pexip/gst-plugins-good,StreamUtils/gst-plugins-good,pexip/gst-plugins-good,GrokImageCompression/gst-plugins-good,GrokImageCompression/gst-plugins-good,GStreamer/gst-plugins-good,StreamUtils/gst-plugins-good,StreamUtils/gst-plugins-good,StreamUtils/gst-plugins-good,GStreamer/gst-plugins-good,pexip/gst-plugins-good,GrokImageCompression/gst-plugins-good,GrokImageCompression/gst-plugins-good,GStreamer/gst-plugins-good