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
This commit is contained in:
Jan Schmidt 2015-02-04 21:50:51 +11:00
parent 852c040c89
commit a3059bec1f

View file

@ -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