diff options
author | wm4 <wm4@nowhere> | 2013-07-11 19:15:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-11 19:15:09 +0200 |
commit | 23e303859aa93572f00b17e3b2bc0a552ad7c348 (patch) | |
tree | 155f4f429170b770e54bdd630886830168e220bc /stream | |
parent | 7a4f9cc4d2509a0d9afa68ea53ed97b72525d001 (diff) | |
download | mpv-23e303859aa93572f00b17e3b2bc0a552ad7c348.tar.bz2 mpv-23e303859aa93572f00b17e3b2bc0a552ad7c348.tar.xz |
mplayer: fix incorrect audio sync after format changes
This is not directly related to the handling of format changes itself,
but playing audio normally after the change. This was broken: the output
byte rate was not recalculated, so audio-video sync was simply broken.
Fix this by calculating the byte rate on the fly, instead of storing it
in sh_audio.
Format changes are relatively common (switches between stereo and 5.1
in TV recordings), so this fixes a somewhat critical bug.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/tv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/tv.c b/stream/tv.c index e5768a350a..72b67b7f9e 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -794,7 +794,7 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer) sh_audio->gsh->codec = "mp-pcm"; sh_audio->format = audio_format; - sh_audio->i_bps = sh_audio->o_bps = + sh_audio->i_bps = sh_audio->samplerate * sh_audio->samplesize * sh_audio->channels.num; |