diff mbox series

[FFmpeg-devel,02/17] avformat/mux: Don't call ff_toupper4() unnecessarily

Message ID AS8P250MB07440BF7F6D39569564F55AA8F2F9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 5da8b522c85c2fb877917c1df6388312803fb36e
Headers show
Series [FFmpeg-devel,01/17] avcodec/mpeg12dec: Remove redundant function call | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 23, 2022, 7:35 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mux.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 5d89458f82..a7517dae0a 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -148,6 +148,7 @@  static int validate_codec_tag(AVFormatContext *s, AVStream *st)
 {
     const AVCodecTag *avctag;
     enum AVCodecID id = AV_CODEC_ID_NONE;
+    unsigned uppercase_tag = ff_toupper4(st->codecpar->codec_tag);
     int64_t tag  = -1;
 
     /**
@@ -159,7 +160,7 @@  static int validate_codec_tag(AVFormatContext *s, AVStream *st)
     for (int n = 0; s->oformat->codec_tag[n]; n++) {
         avctag = s->oformat->codec_tag[n];
         while (avctag->id != AV_CODEC_ID_NONE) {
-            if (ff_toupper4(avctag->tag) == ff_toupper4(st->codecpar->codec_tag)) {
+            if (ff_toupper4(avctag->tag) == uppercase_tag) {
                 id = avctag->id;
                 if (id == st->codecpar->codec_id)
                     return 1;