X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fresample.c;h=a1018b44fc3c0f526c38705594b197b6cda37e34;hb=d2084402e6034e8d49ea50ebe212c4e8783d028a;hp=82c09fc5024c7427c7042604e533ae84c3324375;hpb=2905e3ff6462431d55f89614b24e2a407707c82a;p=ffmpeg diff --git a/libavcodec/resample.c b/libavcodec/resample.c index 82c09fc5024..a1018b44fc3 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -121,11 +121,11 @@ static void surround_to_stereo(short **output, short *input, int channels, int s short l, r; for (i = 0; i < samples; i++) { - int fl,fr,c,rl,rr,lfe; + int fl,fr,c,rl,rr; fl = input[0]; fr = input[1]; c = input[2]; - lfe = input[3]; + // lfe = input[3]; rl = input[4]; rr = input[5]; @@ -184,7 +184,7 @@ static void ac3_5p1_mux(short *output, short *input1, short *input2, int n) ch8<<7 | ch7<<6 | ch6<<5 | ch5<<4 | ch4<<3 | ch3<<2 | ch2<<1 | ch1<<0 static const uint8_t supported_resampling[MAX_CHANNELS] = { - //ouput channels:1 2 3 4 5 6 7 8 + // output ch: 1 2 3 4 5 6 7 8 SUPPORT_RESAMPLE(1, 1, 0, 0, 0, 0, 0, 0), // 1 input channel SUPPORT_RESAMPLE(1, 1, 0, 0, 0, 1, 0, 0), // 2 input channels SUPPORT_RESAMPLE(0, 0, 1, 0, 0, 0, 0, 0), // 3 input channels @@ -239,8 +239,8 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, s->sample_fmt[0] = sample_fmt_in; s->sample_fmt[1] = sample_fmt_out; - s->sample_size[0] = av_get_bits_per_sample_fmt(s->sample_fmt[0]) >> 3; - s->sample_size[1] = av_get_bits_per_sample_fmt(s->sample_fmt[1]) >> 3; + s->sample_size[0] = av_get_bytes_per_sample(s->sample_fmt[0]); + s->sample_size[1] = av_get_bytes_per_sample(s->sample_fmt[1]); if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) { if (!(s->convert_ctx[0] = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,