summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_mpg123.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-09 23:22:15 +0100
committerwm4 <wm4@nowhere>2013-11-09 23:32:58 +0100
commit53d38278431987cc7c266e9fe84d481762bea47a (patch)
tree675d6f2ebce175a7442724842d55f68fbe1aaf1b /audio/decode/ad_mpg123.c
parent0ff863c1797c734dde8c1f99593a01cf5e1c15bc (diff)
downloadmpv-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/ad_mpg123.c')
-rw-r--r--audio/decode/ad_mpg123.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/audio/decode/ad_mpg123.c b/audio/decode/ad_mpg123.c
index df9e82306d..47cb5d2039 100644
--- a/audio/decode/ad_mpg123.c
+++ b/audio/decode/ad_mpg123.c
@@ -206,22 +206,18 @@ static int set_format(sh_audio_t *sh, struct ad_mpg123_context *con)
switch (encoding) {
case MPG123_ENC_SIGNED_8:
sh->sample_format = AF_FORMAT_S8;
- sh->samplesize = 1;
break;
case MPG123_ENC_SIGNED_16:
sh->sample_format = AF_FORMAT_S16_NE;
- sh->samplesize = 2;
break;
/* To stay compatible with the oldest libmpg123 headers, do not rely
* on float and 32 bit encoding symbols being defined.
* Those formats came later */
case 0x1180: /* MPG123_ENC_SIGNED_32 */
sh->sample_format = AF_FORMAT_S32_NE;
- sh->samplesize = 4;
break;
case 0x200: /* MPG123_ENC_FLOAT_32 */
sh->sample_format = AF_FORMAT_FLOAT_NE;
- sh->samplesize = 4;
break;
default:
/* This means we got a funny custom build of libmpg123 that only supports an unknown format. */
@@ -233,7 +229,7 @@ static int set_format(sh_audio_t *sh, struct ad_mpg123_context *con)
/* Going to decode directly to MPlayer's memory. It is important
* to have MPG123_AUTO_RESAMPLE disabled for the buffer size
* being an all-time limit. */
- sh->audio_out_minsize = 1152 * 2 * sh->samplesize;
+ sh->audio_out_minsize = 1152 * 2 * (af_fmt2bits(sh->sample_format) / 8);
#endif
con->new_format = 0;
}