diff options
author | Marcoen Hirschberg <m.hirschberg@activevideo.com> | 2014-05-27 08:21:18 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-28 21:38:00 +0200 |
commit | 31a10f7c38887294af758d21a19596b7772f328a (patch) | |
tree | 545cd862c7bd4cc6c916e91f5a4d69fa586170be /demux/demux_raw.c | |
parent | 434242adb5dc045faf16f8bb19aa740732cc3345 (diff) | |
download | mpv-31a10f7c38887294af758d21a19596b7772f328a.tar.bz2 mpv-31a10f7c38887294af758d21a19596b7772f328a.tar.xz |
af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate
In most places where af_fmt2bits is called to get the bits/sample, the
result is immediately converted to bytes/sample. Avoid this by getting
bytes/sample directly by introducing af_fmt2bps.
Diffstat (limited to 'demux/demux_raw.c')
-rw-r--r-- | demux/demux_raw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux_raw.c b/demux/demux_raw.c index c2579ab536..a17fad795c 100644 --- a/demux/demux_raw.c +++ b/demux/demux_raw.c @@ -94,7 +94,7 @@ static int demux_rawaudio_open(demuxer_t *demuxer, enum demux_check check) sh_audio->channels = channels; w->nChannels = sh_audio->channels.num; w->nSamplesPerSec = sh_audio->samplerate = samplerate; - int samplesize = (af_fmt2bits(aformat) + 7) / 8; + int samplesize = af_fmt2bps(aformat); w->nAvgBytesPerSec = samplerate * samplesize * w->nChannels; w->nBlockAlign = w->nChannels * samplesize; w->wBitsPerSample = 8 * samplesize; |