[FFmpeg-cvslog] avcodec/dcaenc: return correct number of bytes in output packet
Paul B Mahol
git at videolan.org
Mon Jan 25 17:14:00 CET 2016
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jan 25 16:03:17 2016 +0100| [06f65fd026a1a329ecb151f07fc08ca68499cad7] | committer: Paul B Mahol
avcodec/dcaenc: return correct number of bytes in output packet
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=06f65fd026a1a329ecb151f07fc08ca68499cad7
---
libavcodec/dcaenc.c | 4 ++--
tests/fate/acodec.mak | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
index b0cb2fb..ac933dc 100644
--- a/libavcodec/dcaenc.c
+++ b/libavcodec/dcaenc.c
@@ -938,7 +938,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const int32_t *samples;
int ret, i;
- if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size , 0)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size, 0)) < 0)
return ret;
samples = (const int32_t *)frame->data[0];
@@ -968,7 +968,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avpkt->pts = frame->pts;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
- avpkt->size = c->frame_size + 1;
+ avpkt->size = put_bits_count(&c->pb) >> 3;
*got_packet_ptr = 1;
return 0;
}
diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index 4afc27a..e0f2320 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -104,7 +104,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 = c54ca9a13711755ef90fa143a9b38386
+fate-acodec-dca: REF = 7ffdefdf47069289990755c79387cc90
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
More information about the ffmpeg-cvslog
mailing list