]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flacenc.c
Apply 'cold' attribute to init/uninit functions in libavcodec
[ffmpeg] / libavcodec / flacenc.c
index 4f273b7e04e356f2bc0231b3cadcb21bf153abd0..2f07ac56a9387cda23562772f5fd620fa4cb0852 100644 (file)
@@ -169,7 +169,7 @@ static int select_blocksize(int samplerate, int block_time_ms)
     return blocksize;
 }
 
-static int flac_encode_init(AVCodecContext *avctx)
+static av_cold int flac_encode_init(AVCodecContext *avctx)
 {
     int freq = avctx->sample_rate;
     int channels = avctx->channels;
@@ -593,6 +593,9 @@ static void apply_welch_window(const int32_t *data, int len, double *w_data)
     double w;
     double c;
 
+    assert(!(len&1)); //the optimization in r11881 does not support odd len
+                      //if someone wants odd len extend the change in r11881
+
     n2 = (len >> 1);
     c = 2.0 / (len - 1.0);
 
@@ -1483,7 +1486,7 @@ static int flac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
     return out_bytes;
 }
 
-static int flac_encode_close(AVCodecContext *avctx)
+static av_cold int flac_encode_close(AVCodecContext *avctx)
 {
     av_freep(&avctx->extradata);
     avctx->extradata_size = 0;