diff options
author | wm4 <wm4@nowhere> | 2013-11-09 23:22:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-09 23:32:58 +0100 |
commit | 53d38278431987cc7c266e9fe84d481762bea47a (patch) | |
tree | 675d6f2ebce175a7442724842d55f68fbe1aaf1b /stream/tv.c | |
parent | 0ff863c1797c734dde8c1f99593a01cf5e1c15bc (diff) | |
download | mpv-53d38278431987cc7c266e9fe84d481762bea47a.tar.bz2 mpv-53d38278431987cc7c266e9fe84d481762bea47a.tar.xz |
Remove sh_audio->samplesize
This member was redundant. sh_audio->sample_format indicates the sample
size already.
The TV code is a bit strange: the redundant sample size was part of the
internal TV interface. Assume it's really redundant and not something
else. The PCM decoder ignores the sample size anyway.
Diffstat (limited to 'stream/tv.c')
-rw-r--r-- | stream/tv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/stream/tv.c b/stream/tv.c index 0e5fe8c22d..08bb11c6ce 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -794,8 +794,6 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check) funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE, &sh_audio->samplerate); - funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLESIZE, - &sh_audio->samplesize); int nchannels = sh_audio->channels.num; funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_CHANNELS, &nchannels); @@ -804,17 +802,18 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check) sh_audio->gsh->codec = "mp-pcm"; sh_audio->format = audio_format; + int samplesize = af_fmt2bits(audio_format) / 8; + sh_audio->i_bps = - sh_audio->samplerate * sh_audio->samplesize * - sh_audio->channels.num; + sh_audio->samplerate * samplesize * sh_audio->channels.num; // emulate WF for win32 codecs: sh_audio->wf = malloc(sizeof(*sh_audio->wf)); sh_audio->wf->wFormatTag = sh_audio->format; sh_audio->wf->nChannels = sh_audio->channels.num; - sh_audio->wf->wBitsPerSample = sh_audio->samplesize * 8; + sh_audio->wf->wBitsPerSample = samplesize * 8; sh_audio->wf->nSamplesPerSec = sh_audio->samplerate; - sh_audio->wf->nBlockAlign = sh_audio->samplesize * sh_audio->channels.num; + sh_audio->wf->nBlockAlign = samplesize * sh_audio->channels.num; sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps; mp_tmsg(MSGT_DECVIDEO, MSGL_V, " TV audio: %d channels, %d bits, %d Hz\n", |