From e6664e94a12991534b9217e677fed8515a3446d7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Feb 2015 19:32:30 +0100 Subject: demux_disc: fix CDDA seekability The only reason why cdda:// goes through this wrapper-demuxer is so that we add chapters to it. Most things related to seeking apply only to DVD/BD, and in fact broke CDDA sekkability. Fixes #1555. --- demux/demux_disc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'demux') diff --git a/demux/demux_disc.c b/demux/demux_disc.c index 37b189861f..afa8de2298 100644 --- a/demux/demux_disc.c +++ b/demux/demux_disc.c @@ -229,6 +229,11 @@ static int d_fill_buffer(demuxer_t *demuxer) return 1; } + if (demuxer->stream->uncached_type == STREAMTYPE_CDDA) { + demux_add_packet(sh, pkt); + return 1; + } + MP_TRACE(demuxer, "ipts: %d %f %f\n", sh->type, pkt->pts, pkt->dts); if (sh->type == STREAM_SUB) { @@ -311,16 +316,18 @@ static int d_open(demuxer_t *demuxer, enum demux_check check) // So that we don't miss initial packets of delayed subtitle streams. demux_set_stream_autoselect(p->slave, true); - // Can be seekable even if the stream isn't. - demuxer->seekable = true; - - demuxer->rel_seeks = true; - // With cache enabled, the stream can be seekable. This causes demux_lavf.c // (actually libavformat/mpegts.c) to seek sometimes when reading a packet. // It does this to seek back a bit in case the current file position points // into the middle of a packet. - demuxer->stream->seekable = false; + if (demuxer->stream->uncached_type != STREAMTYPE_CDDA) { + demuxer->stream->seekable = false; + + // Can be seekable even if the stream isn't. + demuxer->seekable = true; + + demuxer->rel_seeks = true; + } add_dvd_streams(demuxer); add_streams(demuxer); -- cgit v1.2.3