diff mbox series

[FFmpeg-devel,179/281] lavf: drop the channel layout compat layer for old-style (de)muxers

Message ID 20220113020026.590-31-jamrial@gmail.com
State New
Headers show
Series New channel layout API
Related show

Commit Message

James Almer Jan. 13, 2022, 2 a.m. UTC
From: Anton Khirnov <anton@khirnov.net>

All the (de)muxers have been converted to the new API.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/demux.c | 12 ------------
 libavformat/mux.c   |  9 ---------
 2 files changed, 21 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 29c5f7539c..a9682a5949 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -194,18 +194,6 @@  static int update_stream_avctx(AVFormatContext *s)
             sti->parser = NULL;
         }
 
-        /* if the demuxer exports old channel layouts, convert it to new */
-        if (!st->codecpar->ch_layout.nb_channels &&
-            st->codecpar->channels) {
-            if (st->codecpar->channel_layout) {
-                av_channel_layout_from_mask(&st->codecpar->ch_layout,
-                                            st->codecpar->channel_layout);
-            } else {
-                st->codecpar->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
-                st->codecpar->ch_layout.nb_channels = st->codecpar->channels;
-            }
-        }
-
 #if FF_API_OLD_CHANNEL_LAYOUT
 FF_DISABLE_DEPRECATION_WARNINGS
         if (st->codecpar->ch_layout.nb_channels &&
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 68983c773f..e68738e5c6 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -273,15 +273,6 @@  static int init_muxer(AVFormatContext *s, AVDictionary **options)
                 goto fail;
             }
 
-            /* if the new-style channel layout is set, convert it to old one
-             * for old-style muxers */
-            if (par->ch_layout.nb_channels &&
-                !par->channels) {
-                par->channels       = par->ch_layout.nb_channels;
-                par->channel_layout = par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ?
-                                      par->ch_layout.u.mask : 0;
-            }
-
 #if FF_API_OLD_CHANNEL_LAYOUT
 FF_DISABLE_DEPRECATION_WARNINGS
             /* if the caller is using the deprecated channel layout API,