]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flacenc.c
avcodec/ttmlenc: add support for region positioning and sizing
[ffmpeg] / libavcodec / flacenc.c
index 170c3caf4844f46d7d45ecf22244d4fa1be7ad05..05a85d830fe0b98f5e4726b8178d8b22250c443c 100644 (file)
@@ -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,
 };