summaryrefslogtreecommitdiff
path: root/fftools/ffprobe.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-09-02 21:37:27 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:46 -0300
commita8b885f2944d4fc748ca0efd8f99875950efe8aa (patch)
tree9a12fd701813866f54e7dcc718606ef92ec914d2 /fftools/ffprobe.c
parent987763ac35d3db8beb77e7c5e8426e1b265b2f95 (diff)
ffprobe: convert to new channel layout-API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r--fftools/ffprobe.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 66206b66d9..6de6cc2393 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2531,12 +2531,10 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
if (s) print_str ("sample_fmt", s);
else print_str_opt("sample_fmt", "unknown");
print_int("nb_samples", frame->nb_samples);
- print_int("channels", frame->channels);
- if (frame->channel_layout) {
- av_bprint_clear(&pbuf);
- av_bprint_channel_layout(&pbuf, frame->channels,
- frame->channel_layout);
- print_str ("channel_layout", pbuf.str);
+ print_int("channels", frame->ch_layout.nb_channels);
+ if (frame->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) {
+ av_channel_layout_describe(&frame->ch_layout, val_str, sizeof(val_str));
+ print_str ("channel_layout", val_str);
} else
print_str_opt("channel_layout", "unknown");
break;
@@ -2948,12 +2946,11 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if (s) print_str ("sample_fmt", s);
else print_str_opt("sample_fmt", "unknown");
print_val("sample_rate", par->sample_rate, unit_hertz_str);
- print_int("channels", par->channels);
+ print_int("channels", par->ch_layout.nb_channels);
- if (par->channel_layout) {
- av_bprint_clear(&pbuf);
- av_bprint_channel_layout(&pbuf, par->channels, par->channel_layout);
- print_str ("channel_layout", pbuf.str);
+ if (par->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) {
+ av_channel_layout_describe(&par->ch_layout, val_str, sizeof(val_str));
+ print_str ("channel_layout", val_str);
} else {
print_str_opt("channel_layout", "unknown");
}