avcodec/pcm-blurayenc: fix flawed logic in previous change

release/5.1
Paul B Mahol 3 years ago
parent b67572c7c7
commit a84b95dc08
  1. 8
      libavcodec/pcm-blurayenc.c

@ -38,11 +38,11 @@ static av_cold int pcm_bluray_encode_init(AVCodecContext *avctx)
switch (avctx->sample_fmt) { switch (avctx->sample_fmt) {
case AV_SAMPLE_FMT_S16: case AV_SAMPLE_FMT_S16:
avctx->bits_per_coded_sample = 16; avctx->bits_per_coded_sample = 16;
frame_size = 120; frame_size = 240;
quant = 1; quant = 1;
break; break;
case AV_SAMPLE_FMT_S32: case AV_SAMPLE_FMT_S32:
frame_size = 180; frame_size = 360;
avctx->bits_per_coded_sample = 24; avctx->bits_per_coded_sample = 24;
quant = 3; quant = 3;
break; break;
@ -55,19 +55,15 @@ static av_cold int pcm_bluray_encode_init(AVCodecContext *avctx)
freq = 1; freq = 1;
break; break;
case 96000: case 96000:
frame_size *= 2;
freq = 4; freq = 4;
break; break;
case 192000: case 192000:
frame_size *= 4;
freq = 5; freq = 5;
break; break;
default: default:
return AVERROR_BUG; return AVERROR_BUG;
} }
frame_size *= avctx->ch_layout.nb_channels;
switch (avctx->ch_layout.u.mask) { switch (avctx->ch_layout.u.mask) {
case AV_CH_LAYOUT_MONO: case AV_CH_LAYOUT_MONO:
ch_layout = 1; ch_layout = 1;

Loading…
Cancel
Save