mxfdemux: fix keyframe detection in index

An index entry should be considered as a keyframe
if the flags allow a random access only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2173>
This commit is contained in:
Stéphane Cerveau 2021-04-19 18:25:06 +02:00 committed by GStreamer Marge Bot
parent 51e96fd2c3
commit c32f455b7b

View file

@ -3796,8 +3796,13 @@ collect_index_table_segments (GstMXFDemux * demux)
}
index->offset = offset;
index->keyframe = ! !(segment->index_entries[i].flags & 0x80)
|| (segment->index_entries[i].key_frame_offset == 0);
/* EG41-2004 Table 9: 0x80 = Random access */
/* random_access is more reliable to determine if the index is
* a key-frame than checking the keyframe_offset or the frame type flag.
* See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2173#note_900580
* for more details.
*/
index->keyframe = ! !(segment->index_entries[i].flags & 0x80);
index->dts = pts_i;
}
}