Unified · Split
| @@ -49,6 +49,8 @@ typedef struct SBCEncContext { · 48 unmodified lines | ||
| 49 | 49 | DECLARE_ALIGNED(SBC_ALIGN, SBCDSPContext, dsp); |
| 50 | 50 | } SBCEncContext; |
| 51 | 51 | |
| 52 | +static const int sbc_samplerates[] = { 16000, 32000, 44100, 48000, 0 }; | |
| 53 | + | |
| 52 | 54 | static int sbc_analyze_audio(SBCDSPContext *s, struct sbc_frame *frame) |
| 53 | 55 | { |
| 54 | 56 | int ch, blk; |
| @@ -260,8 +262,8 @@ static av_cold int sbc_encode_init(AVCodecContext *avctx) · 205 unmodified lines | ||
| 260 | 262 | avctx->frame_size = 4*((frame->subbands >> 3) + 1) * 4*(frame->blocks >> 2); |
| 261 | 263 | } |
| 262 | 264 | |
| 263 | − for (int i = 0; avctx->codec->supported_samplerates[i]; i++) | |
| 264 | − if (avctx->sample_rate == avctx->codec->supported_samplerates[i]) | |
| 265 | + for (int i = 0; sbc_samplerates[i]; i++) | |
| 266 | + if (avctx->sample_rate == sbc_samplerates[i]) | |
| 265 | 267 | frame->frequency = i; |
| 266 | 268 | |
| 267 | 269 | frame->channels = avctx->ch_layout.nb_channels; |
| @@ -359,7 +361,7 @@ const FFCodec ff_sbc_encoder = { · 91 unmodified lines | ||
| 359 | 361 | { 0 } }, |
| 360 | 362 | .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, |
| 361 | 363 | AV_SAMPLE_FMT_NONE }, |
| 362 | − .p.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, | |
| 364 | + .p.supported_samplerates = sbc_samplerates, | |
| 363 | 365 | .p.priv_class = &sbc_class, |
| 364 | 366 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_sbc_profiles), |
| 365 | 367 | }; |