summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-02-04 21:50:51 +1100
committerJan Schmidt <jan@centricular.com>2015-02-04 21:58:31 +1100
commita3059bec1f4d32c42d3aae27834fd520c8bbb65d (patch)
tree2430b9aa65b7ee460201c7d322b7535e2d946379
parent852c040c89bd99bd11598a628934a2b48b1e9a64 (diff)
qtdemux: Simple implementation of GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS
When the trickmode key-units flag is set on the segment, simply skip any sample on a video stream that isn't a keyframe
-rw-r--r--gst/isomp4/qtdemux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index baffc76a2..5f1fffac6 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4531,6 +4531,15 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
&offset, &sample_size, &dts, &pts, &duration, &keyframe)))
goto eos_stream;
+ /* If we're doing a keyframe-only trickmode, only push keyframes on video streams */
+ if (G_UNLIKELY (qtdemux->
+ segment.flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS)) {
+ if (stream->subtype == FOURCC_vide && !keyframe) {
+ GST_LOG_OBJECT (qtdemux, "Skipping non-keyframe on stream %d", index);
+ goto next;
+ }
+ }
+
GST_DEBUG_OBJECT (qtdemux,
"pushing from stream %d, empty %d offset %" G_GUINT64_FORMAT
", size %d, dts=%" GST_TIME_FORMAT ", pts=%" GST_TIME_FORMAT