From 05e099f4abf91dcd2fce759ba4e71f9a1acd8601 Mon Sep 17 00:00:00 2001 From: phintuka Date: Mon, 28 Nov 2011 11:20:51 +0000 Subject: Improved audio channel switching: - reset demuxer buffers - reset audio decoder --- xine/demux_xvdr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xine/demux_xvdr.c b/xine/demux_xvdr.c index 44f44d6c..abf52d70 100644 --- a/xine/demux_xvdr.c +++ b/xine/demux_xvdr.c @@ -381,10 +381,23 @@ static void track_audio_stream_change(demux_xvdr_t *this, buf_element_t *buf) #else if (this->audio_type != buf->type) { LOGDBG("audio stream changed: %08x -> %08x", this->audio_type, buf->type); - this->audio_type = buf->type; + + ts_data_reset_audio(this->ts_data, this->audio_fifo, buf->type & 0xff); + put_control_buf(this->audio_fifo, this->audio_fifo, BUF_CONTROL_RESET_TRACK_MAP); + + if (this->audio_type) { + buf_element_t *b = this->audio_fifo->buffer_pool_try_alloc(this->audio_fifo); + if (b) { + b->type = BUF_CONTROL_START; + b->decoder_flags = BUF_FLAG_GAPLESS_SW; + this->audio_fifo->put(this->audio_fifo, b); + } + } + + this->audio_type = buf->type; } #endif } -- cgit v1.2.3