diff options
author | Christopher Martin <christopher.martin@utoronto.ca> | 2009-04-26 09:43:27 -0400 |
---|---|---|
committer | Christopher Martin <christopher.martin@utoronto.ca> | 2009-04-26 09:43:27 -0400 |
commit | 0566022b14ef4a56848e66095b6ccfbdd7db69b9 (patch) | |
tree | 144b59147a5ab57fd5b4ba33f0292503ebe86043 /src | |
parent | 8c3fd22df0ca058d6acd94772d79cd1550627b4d (diff) | |
download | xine-lib-0566022b14ef4a56848e66095b6ccfbdd7db69b9.tar.gz xine-lib-0566022b14ef4a56848e66095b6ccfbdd7db69b9.tar.bz2 |
Fix CD gapless playback.
Similar to the fix in cset 86b9162cfcfe.
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_cdda.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index 8e9ad3679..d48bb2a51 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -60,6 +60,7 @@ typedef struct { input_plugin_t *input; int status; + int send_newpts; int seek_flag; /* this is set when a seek just occurred */ } demux_cdda_t; @@ -91,9 +92,9 @@ static int demux_cdda_send_chunk (demux_plugin_t *this_gen) { buf->extra_info->input_time = buf->pts / 90; buf->decoder_flags |= BUF_FLAG_FRAME_END; - if (this->seek_flag) { - _x_demux_control_newpts(this->stream, buf->pts, BUF_FLAG_SEEK); - this->seek_flag = 0; + if (this->send_newpts) { + _x_demux_control_newpts(this->stream, buf->pts, this->seek_flag); + this->send_newpts = this->seek_flag = 0; } this->audio_fifo->put (this->audio_fifo, buf); @@ -146,9 +147,14 @@ static int demux_cdda_seek (demux_plugin_t *this_gen, off_t start_pos, int start this->input->seek(this->input, start_pos & ~3, SEEK_SET); else this->input->seek(this->input, start_time * CD_BYTES_PER_SECOND, SEEK_SET); - this->seek_flag = 1; + this->status = DEMUX_OK; - _x_demux_flush_engine (this->stream); + + this->send_newpts = 1; + if (playing) { + this->seek_flag = BUF_FLAG_SEEK; + _x_demux_flush_engine (this->stream); + } return this->status; } |