Skip to content

Commit

Permalink
swr: add av_cold to init/free functions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Sep 9, 2012
1 parent dd081f9 commit 31a797e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions libswresample/rematrix.c
Expand Up @@ -133,7 +133,7 @@ static int sane_layout(int64_t layout){
return 1; return 1;
} }


static int auto_matrix(SwrContext *s) av_cold static int auto_matrix(SwrContext *s)
{ {
int i, j, out_i; int i, j, out_i;
double matrix[64][64]={{0}}; double matrix[64][64]={{0}};
Expand Down Expand Up @@ -349,7 +349,7 @@ static int auto_matrix(SwrContext *s)
return 0; return 0;
} }


int swri_rematrix_init(SwrContext *s){ av_cold int swri_rematrix_init(SwrContext *s){
int i, j; int i, j;
int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout);
int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout);
Expand Down Expand Up @@ -409,7 +409,7 @@ int swri_rematrix_init(SwrContext *s){
return 0; return 0;
} }


void swri_rematrix_free(SwrContext *s){ av_cold void swri_rematrix_free(SwrContext *s){
av_freep(&s->native_matrix); av_freep(&s->native_matrix);
av_freep(&s->native_one); av_freep(&s->native_one);
av_freep(&s->native_simd_matrix); av_freep(&s->native_simd_matrix);
Expand Down
6 changes: 3 additions & 3 deletions libswresample/swresample.c
Expand Up @@ -144,7 +144,7 @@ const AVClass *swr_get_class(void)
return &av_class; return &av_class;
} }


struct SwrContext *swr_alloc(void){ av_cold struct SwrContext *swr_alloc(void){
SwrContext *s= av_mallocz(sizeof(SwrContext)); SwrContext *s= av_mallocz(sizeof(SwrContext));
if(s){ if(s){
s->av_class= &av_class; s->av_class= &av_class;
Expand Down Expand Up @@ -187,7 +187,7 @@ static void free_temp(AudioData *a){
memset(a, 0, sizeof(*a)); memset(a, 0, sizeof(*a));
} }


void swr_free(SwrContext **ss){ av_cold void swr_free(SwrContext **ss){
SwrContext *s= *ss; SwrContext *s= *ss;
if(s){ if(s){
free_temp(&s->postin); free_temp(&s->postin);
Expand All @@ -205,7 +205,7 @@ void swr_free(SwrContext **ss){
av_freep(ss); av_freep(ss);
} }


int swr_init(struct SwrContext *s){ av_cold int swr_init(struct SwrContext *s){
s->in_buffer_index= 0; s->in_buffer_index= 0;
s->in_buffer_count= 0; s->in_buffer_count= 0;
s->resample_in_constraint= 0; s->resample_in_constraint= 0;
Expand Down
4 changes: 2 additions & 2 deletions libswresample/x86/swresample_x86.c
Expand Up @@ -30,7 +30,7 @@ PROTO4(_pack_2ch)
PROTO4(_pack_6ch) PROTO4(_pack_6ch)
PROTO4(_unpack_2ch) PROTO4(_unpack_2ch)


void swri_audio_convert_init_x86(struct AudioConvert *ac, av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
enum AVSampleFormat out_fmt, enum AVSampleFormat out_fmt,
enum AVSampleFormat in_fmt, enum AVSampleFormat in_fmt,
int channels){ int channels){
Expand Down Expand Up @@ -149,7 +149,7 @@ D(int16, mmx)
D(int16, sse2) D(int16, sse2)




void swri_rematrix_init_x86(struct SwrContext *s){ av_cold void swri_rematrix_init_x86(struct SwrContext *s){
int mm_flags = av_get_cpu_flags(); int mm_flags = av_get_cpu_flags();
int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout);
int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout);
Expand Down

0 comments on commit 31a797e

Please sign in to comment.