Permalink
Browse files

mlpenc: Add support for mono files

Although surcode doesn't support it, MLP is capable.

This wasn't working till now because max_matrix_channel was hardcoded
to 1.

Signed-off-by: Jai Luthra <me@jailuthra.in>
  • Loading branch information...
jailuthra committed Jun 15, 2016
1 parent 8d00e45 commit 94a4afc7cd6208138b72e5b5e46d2e051fb0bdd6
Showing with 4 additions and 3 deletions.
  1. +4 −3 libavcodec/mlpenc.c
View
@@ -541,9 +541,9 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
ctx->coded_peak_bitrate = mlp_peak_bitrate(9600000, avctx->sample_rate);
/* TODO support more channels. */
- if (avctx->channels != 2) {
+ if (avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR,
- "Only stereo is supported at the moment.\n");
+ "Only mono and stereo are supported at the moment.\n");
return -1;
}
@@ -676,7 +676,8 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
rh->min_channel = 0;
rh->max_channel = avctx->channels - 1;
- rh->max_matrix_channel = 1;
+ /* FIXME: this works for 1 and 2 channels, but check for more */
+ rh->max_matrix_channel = rh->max_channel;
}
clear_channel_params(ctx, restart_channel_params);

0 comments on commit 94a4afc

Please sign in to comment.