From 29cd24bc414c69a6ee1326438764a630581194cd Mon Sep 17 00:00:00 2001 From: Alexey Fisher Date: Sat, 27 Oct 2012 13:24:24 +0100 Subject: [PATCH] matroskademux: mark invisible VP8 frames with the DECODE_ONLY flag https://bugzilla.gnome.org/show_bug.cgi?id=654259 --- gst/matroska/matroska-demux.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 10d3733..049f4b4 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -3431,9 +3431,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, goto data_error; if (ret == GST_FLOW_OK && readblock) { + gboolean invisible_frame = FALSE; + gboolean delta_unit = FALSE; guint64 duration = 0; gint64 lace_time = 0; - gboolean delta_unit; stream = g_ptr_array_index (demux->common.src, stream_num); @@ -3503,8 +3504,13 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, /* 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. */ - delta_unit = stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO && - ((is_simpleblock && !(flags & 0x80)) || referenceblock); + if (stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO) { + if ((is_simpleblock && !(flags & 0x80)) || referenceblock) { + delta_unit = TRUE; + invisible_frame = ((flags & 0x08)) && + (strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8) == 0); + } + } if (delta_unit && stream->set_discont) { /* When doing seeks or such, we need to restart on key frames or @@ -3569,6 +3575,9 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux, else GST_BUFFER_FLAG_UNSET (sub, GST_BUFFER_FLAG_DELTA_UNIT); + if (invisible_frame) + GST_BUFFER_FLAG_SET (sub, GST_BUFFER_FLAG_DECODE_ONLY); + if (stream->encodings != NULL && stream->encodings->len > 0) sub = gst_matroska_decode_buffer (stream, sub); -- 2.7.4