mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 04:42:10 +00:00
dvd: fix first subtitle with delayed subtitle streams
This was accidentally broken with moving the DVD code to demux_disc.c. Also remove an abort() call meant for debugging.
This commit is contained in:
parent
1d55547adf
commit
e3a3b764c8
@ -127,6 +127,7 @@ struct sh_stream *new_sh_stream(demuxer_t *demuxer, enum stream_type type)
|
||||
.ds = talloc_zero(sh, struct demux_stream),
|
||||
};
|
||||
sh->ds->demuxer = demuxer;
|
||||
sh->ds->selected = demuxer->stream_select_default;
|
||||
MP_TARRAY_APPEND(demuxer, demuxer->streams, demuxer->num_streams, sh);
|
||||
switch (sh->type) {
|
||||
case STREAM_VIDEO: sh->video = talloc_zero(demuxer, struct sh_video); break;
|
||||
|
@ -184,6 +184,7 @@ typedef struct demuxer {
|
||||
// File format allows PTS resets (even if the current file is without)
|
||||
bool ts_resets_possible;
|
||||
bool warned_queue_overflow;
|
||||
bool stream_select_default; // initial selection status of a new stream
|
||||
|
||||
// Bitmask of DEMUX_EVENT_*
|
||||
int events;
|
||||
|
@ -179,7 +179,6 @@ static int d_fill_buffer(demuxer_t *demuxer)
|
||||
|
||||
add_streams(demuxer);
|
||||
if (pkt->stream >= p->num_streams) { // out of memory?
|
||||
abort();
|
||||
talloc_free(pkt);
|
||||
return 0;
|
||||
}
|
||||
@ -225,6 +224,9 @@ static int d_open(demuxer_t *demuxer, enum demux_check check)
|
||||
if (!p->slave)
|
||||
return -1;
|
||||
|
||||
// So that we don't miss initial packets of delayed subtitle streams.
|
||||
p->slave->stream_select_default = true;
|
||||
|
||||
// Incorrect, but fixes some behavior
|
||||
demuxer->ts_resets_possible = false;
|
||||
// Doesn't work, because stream_pts is a "guess".
|
||||
|
Loading…
Reference in New Issue
Block a user