Unified · Split
| @@ -195,13 +195,7 @@ static AVStream *create_new_audio_stream(AVFormatContext *s, int id, int info) · 194 unmodified lines | ||
| 195 | 195 | if (!ast) |
| 196 | 196 | return NULL; |
| 197 | 197 | ast->id = id; |
| 198 | − if (info & 1) { | |
| 199 | − ast->codecpar->channels = 2; | |
| 200 | − ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; | |
| 201 | − } else { | |
| 202 | − ast->codecpar->channels = 1; | |
| 203 | − ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO; | |
| 204 | − } | |
| 198 | + av_channel_layout_default(&ast->codecpar->ch_layout, 1 + (info & 1)); | |
| 205 | 199 | ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; |
| 206 | 200 | ast->codecpar->codec_id = ff_codec_get_id(swf_audio_codec_tags, info>>4 & 15); |
| 207 | 201 | ffstream(ast)->need_parsing = AVSTREAM_PARSE_FULL; |
| @@ -348,7 +348,7 @@ static int swf_write_header(AVFormatContext *s) · 347 unmodified lines | ||
| 348 | 348 | return -1; |
| 349 | 349 | } |
| 350 | 350 | v |= 0x02; /* 16 bit playback */ |
| 351 | − if (swf->audio_par->channels == 2) | |
| 351 | + if (swf->audio_par->ch_layout.nb_channels == 2) | |
| 352 | 352 | v |= 0x01; /* stereo playback */ |
| 353 | 353 | avio_w8(s->pb, v); |
| 354 | 354 | v |= 0x20; /* mp3 compressed */ |