diff options
author | Torsten Jager <t.jager@gmx.de> | 2011-08-22 11:49:01 +0200 |
---|---|---|
committer | Torsten Jager <t.jager@gmx.de> | 2011-08-22 11:49:01 +0200 |
commit | 078eade9b4a427497250ca567ebe1865ecd47a8f (patch) | |
tree | 00bb4c78c99c0aedbccc744fb8847af61a5ce34f /src | |
parent | e96bac07aae3a9677661fd581b7c7e4e98964831 (diff) | |
download | xine-lib-078eade9b4a427497250ca567ebe1865ecd47a8f.tar.gz xine-lib-078eade9b4a427497250ca567ebe1865ecd47a8f.tar.bz2 |
Audio crash fix
Audio decoder loop creates a sorted map of available audio channels on the
fly. If neither user nor dvdnav intervene, it will pass the first (= lowest
index) audio channel to decoders.
Now imagine a TV recording with 2 audio channels:
audio.0: eac3 5.1 (fra)
audio.1: eac3 stereo (qaa)
By chance, first audio frame to be demuxed is for channel #1.
Track map will be
[0]: eac3, channel 1
Audio loop opens ffmpeg audio decoder / stereo out. Fine.
Then, first frame for channel #0 comes in.
[0]: eac3, channel 0
[1]: eac3, channel 1
Both are same codec, so audio loop just switches to channel 0 without
further notice. Audio decoder then runs into a mem leak, or worse, crashes
audio out who still thinks we're only stereo.
Whenever we insert something at track map index 0, and its going to be
auto-selected later, reset current codec type. This forces a clean
decoder/output switch.
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 3d5ef7e6f..10c20f231 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -283,6 +283,9 @@ static void *audio_decoder_loop (void *stream_gen) { } stream->audio_track_map[i] = buf->type; stream->audio_track_map_entries++; + /* implicit channel change - reopen decoder below */ + if ((i == 0) && (audio_channel_user == -1) && (stream->audio_channel_auto < 0)) + stream->audio_decoder_streamtype = -1; ui_event.type = XINE_EVENT_UI_CHANNELS_CHANGED; ui_event.data_length = 0; |