mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
matroskademux: Simple implementation of 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 https://bugzilla.gnome.org/show_bug.cgi?id=762185
This commit is contained in:
parent
77403d0afe
commit
750b7c72fe
1 changed files with 14 additions and 3 deletions
|
@ -3536,16 +3536,27 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
|||
}
|
||||
/* else duration is diff between timecode of this and next block */
|
||||
|
||||
/* For SimpleBlock, look at the keyframe bit in flags. Otherwise,
|
||||
a ReferenceBlock implies that this is not a keyframe. In either
|
||||
case, it only makes sense for video streams. */
|
||||
if (stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO) {
|
||||
/* For SimpleBlock, look at the keyframe bit in flags. Otherwise,
|
||||
a ReferenceBlock implies that this is not a keyframe. In either
|
||||
case, it only makes sense for video streams. */
|
||||
if ((is_simpleblock && !(flags & 0x80)) || referenceblock) {
|
||||
delta_unit = TRUE;
|
||||
invisible_frame = ((flags & 0x08)) &&
|
||||
(!strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8) ||
|
||||
!strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP9));
|
||||
}
|
||||
|
||||
/* If we're doing a keyframe-only trickmode, only push keyframes on video
|
||||
* streams */
|
||||
if (delta_unit
|
||||
&& demux->common.
|
||||
segment.flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS) {
|
||||
GST_LOG_OBJECT (demux, "Skipping non-keyframe on stream %d",
|
||||
stream->index);
|
||||
ret = GST_FLOW_OK;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
for (n = 0; n < laces; n++) {
|
||||
|
|
Loading…
Reference in a new issue