Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/flvenc: use local variable to shorten code
@ 2023-04-06 19:31 Zhao Zhili
  0 siblings, 0 replies; only message in thread
From: Zhao Zhili @ 2023-04-06 19:31 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili

From: Zhao Zhili <zhilizhao@tencent.com>

---
 libavformat/flvenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 64ea554dad..a7b5efde4b 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
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-06 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 19:31 [FFmpeg-devel] [PATCH] avformat/flvenc: use local variable to shorten code Zhao Zhili

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git