diff mbox series

[FFmpeg-devel,16/18] avformat/matroskaenc: Move AAC extradata check to other audio checks

Message ID AM7PR03MB66607039E993C4F2B9DC117A8F4D9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit d266bf17988271d529fd2209681889a78b9f259c
Headers show
Series [FFmpeg-devel] avformat/Makefile: Add missing libamqp->urldecode dependency | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 7, 2022, 10:53 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 6ba1dadee9..303aa1ce50 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1173,13 +1173,6 @@  static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
     if (par->codec_type == AVMEDIA_TYPE_ATTACHMENT)
         return 0;
 
-    if (par->codec_id == AV_CODEC_ID_AAC) {
-        ret = get_aac_sample_rates(s, mkv, par->extradata, par->extradata_size,
-                                   &sample_rate, &output_sample_rate);
-        if (ret < 0)
-            return ret;
-    }
-
     track_master = start_ebml_master(pb, MATROSKA_ID_TRACKENTRY, 0);
     put_ebml_uint(pb, MATROSKA_ID_TRACKNUMBER, track->track_num);
     put_ebml_uid (pb, MATROSKA_ID_TRACKUID,    track->uid);
@@ -1377,6 +1370,12 @@  static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
         }
         if (par->codec_id == AV_CODEC_ID_OPUS)
             put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);
+        else if (par->codec_id == AV_CODEC_ID_AAC) {
+            ret = get_aac_sample_rates(s, mkv, par->extradata, par->extradata_size,
+                                       &sample_rate, &output_sample_rate);
+            if (ret < 0)
+                return ret;
+        }
 
         put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO);