summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-01-20 16:38:44 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:47 -0300
commit50e9e11316064ecdee889b18a0b6681a248edcf4 (patch)
treefc2aaab83c42a0e253cc6eea0a603141ca45eb8f /tools
parent7d532f474de2c9dc05e75a8bbb8fc57d11069a8f (diff)
tools: convert to new channel layout-API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/graph2dot.c3
-rw-r--r--tools/ismindex.c2
-rw-r--r--tools/sidxindex.c2
-rw-r--r--tools/uncoded_frame.c5
4 files changed, 6 insertions, 6 deletions
diff --git a/tools/graph2dot.c b/tools/graph2dot.c
index fd7ea2848e..d96bfd8126 100644
--- a/tools/graph2dot.c
+++ b/tools/graph2dot.c
@@ -91,8 +91,7 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
link->time_base.num, link->time_base.den);
} else if (link->type == AVMEDIA_TYPE_AUDIO) {
char buf[255];
- av_get_channel_layout_string(buf, sizeof(buf), -1,
- link->channel_layout);
+ av_channel_layout_describe(&link->ch_layout, buf, sizeof(buf));
fprintf(outfile,
"fmt:%s sr:%d cl:%s tb:%d/%d",
av_get_sample_fmt_name(link->format),
diff --git a/tools/ismindex.c b/tools/ismindex.c
index d355cffe38..39b5378190 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -574,7 +574,7 @@ static int handle_file(struct Tracks *tracks, const char *file, int split,
if (tracks->audio_track < 0)
tracks->audio_track = tracks->nb_tracks;
tracks->nb_audio_tracks++;
- track->channels = st->codecpar->channels;
+ track->channels = st->codecpar->ch_layout.nb_channels;
track->sample_rate = st->codecpar->sample_rate;
if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
track->fourcc = "AACL";
diff --git a/tools/sidxindex.c b/tools/sidxindex.c
index a4f95515e4..88aea6bcb9 100644
--- a/tools/sidxindex.c
+++ b/tools/sidxindex.c
@@ -191,7 +191,7 @@ static int handle_file(struct Tracks *tracks, const char *file)
track->timescale, AV_ROUND_UP));
if (track->is_audio) {
- track->channels = st->codecpar->channels;
+ track->channels = st->codecpar->ch_layout.nb_channels;
track->sample_rate = st->codecpar->sample_rate;
}
if (track->is_video) {
diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c
index f441d3fbdc..edea2367c4 100644
--- a/tools/uncoded_frame.c
+++ b/tools/uncoded_frame.c
@@ -173,8 +173,9 @@ int main(int argc, char **argv)
st->stream->codecpar->format = av_buffersink_get_format(st->sink);
break;
case AVMEDIA_TYPE_AUDIO:
- st->stream->codecpar->channel_layout = av_buffersink_get_channel_layout(st->sink);
- st->stream->codecpar->channels = av_buffersink_get_channels(st->sink);
+ ret = av_buffersink_get_ch_layout(st->sink, &st->stream->codecpar->ch_layout);
+ if (ret < 0)
+ goto fail;
st->stream->codecpar->sample_rate = av_buffersink_get_sample_rate(st->sink);
st->stream->codecpar->format = av_buffersink_get_format(st->sink);
st->stream->codecpar->codec_id = av_get_pcm_codec(st->stream->codecpar->format, -1);