summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-06 19:02:49 +0200
committerwm4 <wm4@nowhere>2014-07-06 19:02:49 +0200
commite3a3b764c8a98fbdca2e0e3677fdcf233169d666 (patch)
tree0ce961b415e5c6282f4b3c7edf7e1b2e35dd2879 /demux
parent1d55547adf37f94be3bec973b59067c474e9d439 (diff)
downloadmpv-e3a3b764c8a98fbdca2e0e3677fdcf233169d666.tar.bz2
mpv-e3a3b764c8a98fbdca2e0e3677fdcf233169d666.tar.xz
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.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c1
-rw-r--r--demux/demux.h1
-rw-r--r--demux/demux_disc.c4
3 files changed, 5 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 3e08a7828b..047e77a486 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -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;
diff --git a/demux/demux.h b/demux/demux.h
index 3567e830c0..c59af6a2fa 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -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;
diff --git a/demux/demux_disc.c b/demux/demux_disc.c
index 823d5727c4..b8835da3c4 100644
--- a/demux/demux_disc.c
+++ b/demux/demux_disc.c
@@ -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".