summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-11-28 11:20:51 +0000
committerphintuka <phintuka>2011-11-28 11:20:51 +0000
commit05e099f4abf91dcd2fce759ba4e71f9a1acd8601 (patch)
tree625bd60d2f540c4dbaf13b07a7226043e6cb3878
parent5c7d59c4190a7d1fdec2b2267fdc0e5445848ccc (diff)
downloadxineliboutput-05e099f4abf91dcd2fce759ba4e71f9a1acd8601.tar.gz
xineliboutput-05e099f4abf91dcd2fce759ba4e71f9a1acd8601.tar.bz2
Improved audio channel switching:
- reset demuxer buffers - reset audio decoder
-rw-r--r--xine/demux_xvdr.c15
1 files changed, 14 insertions, 1 deletions
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
}