summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-11 19:15:09 +0200
committerwm4 <wm4@nowhere>2013-07-11 19:15:09 +0200
commit23e303859aa93572f00b17e3b2bc0a552ad7c348 (patch)
tree155f4f429170b770e54bdd630886830168e220bc /stream
parent7a4f9cc4d2509a0d9afa68ea53ed97b72525d001 (diff)
downloadmpv-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.c2
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;