0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02: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:
wm4 2014-07-06 19:02:49 +02:00
parent 1d55547adf
commit e3a3b764c8
3 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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".