X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fflacenc.c;h=05a85d830fe0b98f5e4726b8178d8b22250c443c;hb=1137ddf3302ef12525c9c95767e6daa0c1031ce7;hp=170c3caf4844f46d7d45ecf22244d4fa1be7ad05;hpb=768b07e3bca7e81d2f9c60badb3973d3d88481dc;p=ffmpeg diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 170c3caf484..05a85d830fe 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1234,7 +1234,7 @@ static void write_frame_header(FlacEncodeContext *s) flush_put_bits(&s->pb); crc = av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, s->pb.buf, - put_bits_count(&s->pb) >> 3); + put_bytes_output(&s->pb)); put_bits(&s->pb, 8, crc); } @@ -1304,7 +1304,7 @@ static void write_frame_footer(FlacEncodeContext *s) int crc; flush_put_bits(&s->pb); crc = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, s->pb.buf, - put_bits_count(&s->pb)>>3)); + put_bytes_output(&s->pb))); put_bits(&s->pb, 16, crc); flush_put_bits(&s->pb); } @@ -1316,7 +1316,7 @@ static int write_frame(FlacEncodeContext *s, AVPacket *avpkt) write_frame_header(s); write_subframes(s); write_frame_footer(s); - return put_bits_count(&s->pb) >> 3; + return put_bytes_output(&s->pb); } @@ -1508,9 +1508,10 @@ AVCodec ff_flac_encoder = { .init = flac_encode_init, .encode2 = flac_encode_frame, .close = flac_encode_close, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_LOSSLESS, + .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .priv_class = &flac_encoder_class, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };