diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-04 03:11:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-19 03:51:37 +0100 |
commit | dd19374ed71a6bc05c5a899decee9bdb40752e5e (patch) | |
tree | 632e2ef5591de4506fa3d0e993a79f9dbc3e6bb0 | |
parent | ec328dc4618201d63c521049d351a162025de04b (diff) | |
download | ffmpeg-dd19374ed71a6bc05c5a899decee9bdb40752e5e.tar.gz |
avcodec/dcaenc: clear bitstream end
This avoids leaving uninitialized bits in the output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e322b7061f873e8fd33b9e518caa19b87616a528)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/dcaenc.c | 4 | ||||
-rw-r--r-- | tests/fate/acodec.mak | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index d57d658122..59c6f68300 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -939,6 +939,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, for (i = 0; i < SUBFRAMES; i++) put_subframe(c, i); + + for (i = put_bits_count(&c->pb); i < 8*c->frame_size; i++) + put_bits(&c->pb, 1, 0); + flush_put_bits(&c->pb); avpkt->pts = frame->pts; diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak index b7e510c272..bcb1189fb9 100644 --- a/tests/fate/acodec.mak +++ b/tests/fate/acodec.mak @@ -103,7 +103,7 @@ fate-acodec-dca: tests/data/asynth-44100-2.wav fate-acodec-dca: SRC = tests/data/asynth-44100-2.wav fate-acodec-dca: CMD = md5 -i $(TARGET_PATH)/$(SRC) -c:a dca -strict -2 -f dts -flags +bitexact fate-acodec-dca: CMP = oneline -fate-acodec-dca: REF = fe28cef432ed88de4ee01b87537fd2bd +fate-acodec-dca: REF = c54ca9a13711755ef90fa143a9b38386 FATE_ACODEC-$(call ENCDEC, DCA, WAV) += fate-acodec-dca2 fate-acodec-dca2: CMD = enc_dec_pcm dts wav s16le $(SRC) -c:a dca -strict -2 -flags +bitexact |