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 /audio/decode/dec_audio.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 'audio/decode/dec_audio.c')
-rw-r--r-- | audio/decode/dec_audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 127139ff60..e381a12a3c 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -58,7 +58,6 @@ static int init_audio_codec(sh_audio_t *sh_audio, const char *decoder) { assert(!sh_audio->initialized); resync_audio_stream(sh_audio); - sh_audio->samplesize = 4; sh_audio->sample_format = AF_FORMAT_FLOAT_NE; sh_audio->audio_out_minsize = 8192; // default, preinit() may change it if (!sh_audio->ad_driver->preinit(sh_audio)) { @@ -305,7 +304,8 @@ int decode_audio(sh_audio_t *sh_audio, struct bstr *outbuf, int minlen) // Indicates that a filter seems to be buffering large amounts of data int huge_filter_buffer = 0; // Decoded audio must be cut at boundaries of this many bytes - int unitsize = sh_audio->channels.num * sh_audio->samplesize * 16; + int bps = af_fmt2bits(sh_audio->sample_format) / 8; + int unitsize = sh_audio->channels.num * bps * 16; /* Filter output size will be about filter_multiplier times input size. * If some filter buffers audio in big blocks this might only hold |