History

swf: convert to new channel layout API

Vittorio Giovara committed 9 years ago

Commit 9ff843e1 parent d38166a2 files · +2 −8Browse files

Unified · Split

2 files
  1. libavformat/swfdec.c +1 −7
  2. libavformat/swfenc.c +1 −1
libavformat/swfdec.c+1−7
@@ -195,13 +195,7 @@ static AVStream *create_new_audio_stream(AVFormatContext *s, int id, int info) · 194 unmodified lines
195195 if (!ast)
196196 return NULL;
197197 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));
205199 ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
206200 ast->codecpar->codec_id = ff_codec_get_id(swf_audio_codec_tags, info>>4 & 15);
207201 ffstream(ast)->need_parsing = AVSTREAM_PARSE_FULL;
libavformat/swfenc.c+1−1
@@ -348,7 +348,7 @@ static int swf_write_header(AVFormatContext *s) · 347 unmodified lines
348348 return -1;
349349 }
350350 v |= 0x02; /* 16 bit playback */
351− if (swf->audio_par->channels == 2)
351+ if (swf->audio_par->ch_layout.nb_channels == 2)
352352 v |= 0x01; /* stereo playback */
353353 avio_w8(s->pb, v);
354354 v |= 0x20; /* mp3 compressed */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t