Skip to content

demux: mp4: Allow deselecting finished tracks

Andrey Turkin requested to merge andrey.turkin/vlc:mov-track-reselect into master

Completed tracks were ignored from selection/deselection, so they stayed always selected. This breaks re-selecting e.g. embedded TTML subtitles which consist of a single large sample spanning an entire media time.

Example of this bug:

  • open an mp4 file with several embedded TTML tracks (each with a single sample containing the entire subtitle data)
  • switch to first TTML track; it gets selected, demuxed, decoded and presented as expected
  • switch to second TTML track; first track decoder/spu gets destroyed but demuxer keeps it selected, as it has completed its demuxing; second track gets selected, demuxed, decoded and presented as expected
  • switch back to first TTML track; second track's decoder/spu gets destroyed but demuxer keeps it selected also; first track doesn't get selected though since it is already selected and completed. No subtitles are presented
  • switch back to second TTML track; same thing happens - and no subtitles are presented

Clearly demuxer is inconsistent here - its behaviour when selecting a "deselected" track changes whether it is the first time the track is selected or not. This MR makes it consistent - newly selected track get selected (and rewound) regardless of its history.

Merge request reports