diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2023-04-07 03:31:40 +0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2023-04-15 04:21:33 +0800 |
commit | d5fdfbac4a933d52f17729555ab447be80d68bd5 (patch) | |
tree | c8714d3cffedc5b3571374782d10c1beb5ce9d52 /libavformat | |
parent | f0f596dbc6b45b544d2d2d4fb78c0a2bdc3e6eb1 (diff) | |
download | ffmpeg-d5fdfbac4a933d52f17729555ab447be80d68bd5.tar.gz |
avformat/flvenc: use local variable to shorten code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/flvenc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index fbf7eabaf8..7873a0080f 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -508,18 +508,18 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i if (!par->extradata_size && (flv->flags & FLV_AAC_SEQ_HEADER_DETECT)) { PutBitContext pbc; int samplerate_index; - int channels = flv->audio_par->ch_layout.nb_channels - - (flv->audio_par->ch_layout.nb_channels == 8 ? 1 : 0); + int channels = par->ch_layout.nb_channels + - (par->ch_layout.nb_channels == 8 ? 1 : 0); uint8_t data[2]; for (samplerate_index = 0; samplerate_index < 16; samplerate_index++) - if (flv->audio_par->sample_rate + if (par->sample_rate == ff_mpeg4audio_sample_rates[samplerate_index]) break; init_put_bits(&pbc, data, sizeof(data)); - put_bits(&pbc, 5, flv->audio_par->profile + 1); //profile + put_bits(&pbc, 5, par->profile + 1); //profile put_bits(&pbc, 4, samplerate_index); //sample rate index put_bits(&pbc, 4, channels); put_bits(&pbc, 1, 0); //frame length - 1024 samples |