From 9ff843eb4a5ca4c82bd42c737eefbb29d5d26084 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Fri, 31 Mar 2017 18:38:42 +0200 Subject: swf: convert to new channel layout API Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/swfdec.c | 8 +------- libavformat/swfenc.c | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index e549e4f50b..52c5e5c480 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -195,13 +195,7 @@ static AVStream *create_new_audio_stream(AVFormatContext *s, int id, int info) if (!ast) return NULL; ast->id = id; - if (info & 1) { - ast->codecpar->channels = 2; - ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; - } else { - ast->codecpar->channels = 1; - ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO; - } + av_channel_layout_default(&ast->codecpar->ch_layout, 1 + (info & 1)); ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ast->codecpar->codec_id = ff_codec_get_id(swf_audio_codec_tags, info>>4 & 15); ffstream(ast)->need_parsing = AVSTREAM_PARSE_FULL; diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c index 9eb22ee9b3..1c020bddcc 100644 --- a/libavformat/swfenc.c +++ b/libavformat/swfenc.c @@ -348,7 +348,7 @@ static int swf_write_header(AVFormatContext *s) return -1; } v |= 0x02; /* 16 bit playback */ - if (swf->audio_par->channels == 2) + if (swf->audio_par->ch_layout.nb_channels == 2) v |= 0x01; /* stereo playback */ avio_w8(s->pb, v); v |= 0x20; /* mp3 compressed */ -- cgit v1.2.3