From e4c955e4d794c5cd69273ccb5e7e25f34dec8d14 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 7 Jul 2016 17:20:58 +0200 Subject: [PATCH] adaptivedemux: Also consider more seek flags as "snap" seeks In the case of KEY_UNIT and TRICKMODE_KEY_UNITS seeks, we want to "snap" to the closest fragment. Without this, we end up pushing out a segment which does not match the first fragment timestamp being pushed out, resulting in one or more buffers being eventually dropped because they are out of segment. --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 5e967bf..51418d3 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1249,9 +1249,11 @@ gst_adaptive_demux_can_seek (GstAdaptiveDemux * demux) return klass->seek != NULL; } -#define IS_SNAP_SEEK(f) (f & (GST_SEEK_FLAG_SNAP_BEFORE | \ - GST_SEEK_FLAG_SNAP_AFTER | \ - GST_SEEK_FLAG_SNAP_NEAREST)) +#define IS_SNAP_SEEK(f) (f & (GST_SEEK_FLAG_SNAP_BEFORE | \ + GST_SEEK_FLAG_SNAP_AFTER | \ + GST_SEEK_FLAG_SNAP_NEAREST | \ + GST_SEEK_FLAG_TRICKMODE_KEY_UNITS | \ + GST_SEEK_FLAG_KEY_UNIT)) #define REMOVE_SNAP_FLAGS(f) (f & ~(GST_SEEK_FLAG_SNAP_BEFORE | \ GST_SEEK_FLAG_SNAP_AFTER | \ GST_SEEK_FLAG_SNAP_NEAREST)) -- 2.7.4