aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/swfdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r--libavformat/swfdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 193df25e2f..6918b01de1 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -21,6 +21,7 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "swf.h"
@@ -194,7 +195,13 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!ast)
return AVERROR(ENOMEM);
ast->id = -1; /* -1 to avoid clash with video stream ch_id */
- ast->codec->channels = 1 + (v&1);
+ if (v & 1) {
+ ast->codec->channels = 2;
+ ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ ast->codec->channels = 1;
+ ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
ast->need_parsing = AVSTREAM_PARSE_FULL;