comparison av_helpers.c @ 36338:d9d308031e9e

Fix channel reordering for ac3_fixed encoder.
author reimar
date Fri, 30 Aug 2013 19:25:11 +0000
parents f77a74ebb95e
children 636c79b71de9
comparison
equal deleted inserted replaced
36337:805ff0c5b699 36338:d9d308031e9e
118 int lavc_encode_audio(AVCodecContext *ctx, void *src, int src_len, void *dst, int dst_len) 118 int lavc_encode_audio(AVCodecContext *ctx, void *src, int src_len, void *dst, int dst_len)
119 { 119 {
120 void *orig_src = src; 120 void *orig_src = src;
121 int bps = av_get_bytes_per_sample(ctx->sample_fmt); 121 int bps = av_get_bytes_per_sample(ctx->sample_fmt);
122 int planar = ctx->channels > 1 && av_sample_fmt_is_planar(ctx->sample_fmt); 122 int planar = ctx->channels > 1 && av_sample_fmt_is_planar(ctx->sample_fmt);
123 int isac3 = ctx->codec->id == AV_CODEC_ID_AC3;
123 int n; 124 int n;
124 int got; 125 int got;
125 AVPacket pkt; 126 AVPacket pkt;
126 AVFrame *frame = avcodec_alloc_frame(); 127 AVFrame *frame = avcodec_alloc_frame();
127 if ((ctx->channels == 6 || ctx->channels == 5) && 128 if ((ctx->channels == 6 || ctx->channels == 5) &&
128 (!strcmp(ctx->codec->name,"ac3") || !strcmp(ctx->codec->name,"libfaac"))) { 129 (isac3 || !strcmp(ctx->codec->name,"libfaac"))) {
129 int isac3 = !strcmp(ctx->codec->name,"ac3");
130 reorder_channel_nch(src, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, 130 reorder_channel_nch(src, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
131 isac3 ? AF_CHANNEL_LAYOUT_LAVC_DEFAULT : AF_CHANNEL_LAYOUT_AAC_DEFAULT, 131 isac3 ? AF_CHANNEL_LAYOUT_LAVC_DEFAULT : AF_CHANNEL_LAYOUT_AAC_DEFAULT,
132 ctx->channels, 132 ctx->channels,
133 src_len / bps, bps); 133 src_len / bps, bps);
134 } 134 }