History

avcodec/aac/aacdec: Avoid branch to set sample_fmt

Andreas Rheinhardt committed 2 years ago

Commit 41ea3171 parent ef168821 file · +6 −5Browse files

Showing the changes to libavcodec/aac (1 of 1 file). Show all

Unified · Split

libavcodec/aac/aacdec.c+6−5
@@ -1193,11 +1193,6 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx) · 1192 unmodified lines
1193 ac->avctx = avctx;1193 ac->avctx = avctx;
1194 ac->oc[1].m4ac.sample_rate = avctx->sample_rate;1194 ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
1195 1195
1196 if (ac->is_fixed)
1197 avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
1198 else
1199 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
1200
1201 if (avctx->extradata_size > 0) {1196 if (avctx->extradata_size > 0) {
1202 if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,1197 if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
1203 avctx->extradata,1198 avctx->extradata,
@@ -1247,14 +1242,20 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx) · 43 unmodified lines
1247static av_cold int aac_decode_init(AVCodecContext *avctx)1242static av_cold int aac_decode_init(AVCodecContext *avctx)
1248{1243{
1249 AACDecContext *ac = avctx->priv_data;1244 AACDecContext *ac = avctx->priv_data;
1245
1250 ac->is_fixed = 0;1246 ac->is_fixed = 0;
1247 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
1248
1251 return aac_decode_init_internal(avctx);1249 return aac_decode_init_internal(avctx);
1252}1250}
1253 1251
1254static av_cold int aac_decode_init_fixed(AVCodecContext *avctx)1252static av_cold int aac_decode_init_fixed(AVCodecContext *avctx)
1255{1253{
1256 AACDecContext *ac = avctx->priv_data;1254 AACDecContext *ac = avctx->priv_data;
1255
1257 ac->is_fixed = 1;1256 ac->is_fixed = 1;
1257 avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
1258
1258 return aac_decode_init_internal(avctx);1259 return aac_decode_init_internal(avctx);
1259}1260}
1260 1261

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t