Unified · Split
| @@ -743,9 +743,12 @@ static void encode_frame(MpegAudioContext *s, · 742 unmodified lines | |||
| 743 | 743 | ||
| 744 | av_assert1(put_bits_left(p) == padding); | 744 | av_assert1(put_bits_left(p) == padding); |
| 745 | 745 | ||
| 746 | /* flush */ | ||
| 747 | flush_put_bits(p); | ||
| 748 | |||
| 746 | /* padding */ | 749 | /* padding */ |
| 747 | for(i=0;i<padding;i++) | 750 | if (put_bytes_left(p, 0)) |
| 748 | put_bits(p, 1, 0); | 751 | memset(put_bits_ptr(p), 0, put_bytes_left(p, 0)); |
| 749 | } | 752 | } |
| 750 | 753 | ||
| 751 | static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, | 754 | static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, |
| @@ -778,9 +781,6 @@ static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 26 unmodified lines | |||
| 778 | 781 | ||
| 779 | encode_frame(s, bit_alloc, padding); | 782 | encode_frame(s, bit_alloc, padding); |
| 780 | 783 | ||
| 781 | /* flush */ | ||
| 782 | flush_put_bits(&s->pb); | ||
| 783 | |||
| 784 | if (frame->pts != AV_NOPTS_VALUE) | 784 | if (frame->pts != AV_NOPTS_VALUE) |
| 785 | avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding); | 785 | avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding); |
| 786 | 786 | ||