summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOgnyan Tonchev <ognyan@axis.com>2016-02-17 14:37:44 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-02-17 16:17:13 +0200
commit750b7c72fe8f19bdcbda9d02ffbb1816bdef507b (patch)
treec12e1f9c763dbefe33505461d9094365b3303a70
parent77403d0afee635f2de6c2e53a23e1f50ad0d00fa (diff)
downloadgstreamer-plugins-good-750b7c72fe8f19bdcbda9d02ffbb1816bdef507b.tar.gz
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
-rw-r--r--gst/matroska/matroska-demux.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 6b3efca02..fe9df563b 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -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++) {