Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -525,11 +525,10 @@ static void copy_samples(FlacEncodeContext *s, const void *samples) · 524 unmodified lines | ||
| 525 | 525 | { |
| 526 | 526 | int i, j, ch; |
| 527 | 527 | FlacFrame *frame; |
| 528 | − int shift = av_get_bytes_per_sample(s->avctx->sample_fmt) * 8 - | |
| 529 | − s->avctx->bits_per_raw_sample; | |
| 530 | 528 | |
| 531 | −#define COPY_SAMPLES(bits) do { \ | |
| 529 | +#define COPY_SAMPLES(bits, shift0) do { \ | |
| 532 | 530 | const int ## bits ## _t *samples0 = samples; \ |
| 531 | + const int shift = shift0; \ | |
| 533 | 532 | frame = &s->frame; \ |
| 534 | 533 | for (i = 0, j = 0; i < frame->blocksize; i++) \ |
| 535 | 534 | for (ch = 0; ch < s->channels; ch++, j++) \ |
| @@ -537,9 +536,9 @@ static void copy_samples(FlacEncodeContext *s, const void *samples) · 1 unmodified line | ||
| 537 | 536 | } while (0) |
| 538 | 537 | |
| 539 | 538 | if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S16) |
| 540 | − COPY_SAMPLES(16); | |
| 539 | + COPY_SAMPLES(16, 0); | |
| 541 | 540 | else |
| 542 | − COPY_SAMPLES(32); | |
| 541 | + COPY_SAMPLES(32, 32 - s->avctx->bits_per_raw_sample); | |
| 543 | 542 | } |
| 544 | 543 | |
| 545 | 544 | |