1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 00:29:02 +00:00

demux_mkv: use a single flag to indicate whether cues have been read

Before this commit, the demuxer would in theory accept multiple cues
elements (and append its contents to the index in the order as
encountered during reading). According to the Matroska specification,
there can be only one cues element in the segment, so this seems like
an overcomplication.

Change it so that redundant elements are ignored, like with all other
unique header elements. This makes implementing deferred reading of the
cues element easier.
This commit is contained in:
wm4 2013-05-22 23:57:39 +02:00
parent 89b8154aad
commit 1139eae082

View File

@ -174,6 +174,7 @@ typedef struct mkv_demuxer {
bool parsed_tags;
bool parsed_chapters;
bool parsed_attachments;
bool parsed_cues;
uint64_t skip_to_timecode;
int v_skip_to_keyframe, a_skip_to_keyframe;
@ -1016,10 +1017,11 @@ static int read_header_element(struct demuxer *demuxer, uint32_t id,
return demux_mkv_read_tracks(demuxer);
case MATROSKA_ID_CUES:
if (is_parsed_header(mkv_d, pos))
if (mkv_d->parsed_cues)
break;
if (at_filepos && !seek_pos_id(s, at_filepos, id))
return -1;
mkv_d->parsed_cues = true;
return demux_mkv_read_cues(demuxer);
case MATROSKA_ID_TAGS: