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