matroskademux: mark invisible VP8 frames with the DECODE_ONLY flag

https://bugzilla.gnome.org/show_bug.cgi?id=654259
This commit is contained in:
Alexey Fisher 2012-10-27 13:24:24 +01:00 committed by Tim-Philipp Müller
parent 49f49a2fbf
commit 29cd24bc41

View file

@ -3431,9 +3431,10 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
goto data_error; goto data_error;
if (ret == GST_FLOW_OK && readblock) { if (ret == GST_FLOW_OK && readblock) {
gboolean invisible_frame = FALSE;
gboolean delta_unit = FALSE;
guint64 duration = 0; guint64 duration = 0;
gint64 lace_time = 0; gint64 lace_time = 0;
gboolean delta_unit;
stream = g_ptr_array_index (demux->common.src, stream_num); 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, /* For SimpleBlock, look at the keyframe bit in flags. Otherwise,
a ReferenceBlock implies that this is not a keyframe. In either a ReferenceBlock implies that this is not a keyframe. In either
case, it only makes sense for video streams. */ case, it only makes sense for video streams. */
delta_unit = stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO && if (stream->type == GST_MATROSKA_TRACK_TYPE_VIDEO) {
((is_simpleblock && !(flags & 0x80)) || referenceblock); 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) { if (delta_unit && stream->set_discont) {
/* When doing seeks or such, we need to restart on key frames or /* 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 else
GST_BUFFER_FLAG_UNSET (sub, GST_BUFFER_FLAG_DELTA_UNIT); 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) if (stream->encodings != NULL && stream->encodings->len > 0)
sub = gst_matroska_decode_buffer (stream, sub); sub = gst_matroska_decode_buffer (stream, sub);