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
11931193 ac->avctx = avctx;
11941194 ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
11951195
1196− if (ac->is_fixed)
1197− avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
1198− else
1199− avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
1200−
12011196 if (avctx->extradata_size > 0) {
12021197 if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
12031198 avctx->extradata,
@@ -1247,14 +1242,20 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx) · 43 unmodified lines
12471242 static av_cold int aac_decode_init(AVCodecContext *avctx)
12481243 {
12491244 AACDecContext *ac = avctx->priv_data;
1245+
12501246 ac->is_fixed = 0;
1247+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
1248+
12511249 return aac_decode_init_internal(avctx);
12521250 }
12531251
12541252 static av_cold int aac_decode_init_fixed(AVCodecContext *avctx)
12551253 {
12561254 AACDecContext *ac = avctx->priv_data;
1255+
12571256 ac->is_fixed = 1;
1257+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
1258+
12581259 return aac_decode_init_internal(avctx);
12591260 }
12601261

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