summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ve_lavc.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-08 19:16:21 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-08 19:16:21 +0000
commit479bdb2c08e8789d580c5c6f5a602499b25438f9 (patch)
tree2b9b63468b8425b83bc112e8acc0cc68b4ac515c /libmpcodecs/ve_lavc.c
parent2ac89bd3885fd96de680a2965c105d1b77ace1ca (diff)
downloadmpv-479bdb2c08e8789d580c5c6f5a602499b25438f9.tar.bz2
mpv-479bdb2c08e8789d580c5c6f5a602499b25438f9.tar.xz
change malloc and free to av_ variants where needed.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14432 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ve_lavc.c')
-rw-r--r--libmpcodecs/ve_lavc.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c
index efcd9dc580..a38968a98a 100644
--- a/libmpcodecs/ve_lavc.c
+++ b/libmpcodecs/ve_lavc.c
@@ -437,7 +437,7 @@ static int config(struct vf_instance_s* vf,
char *tmp;
lavc_venc_context->intra_matrix =
- malloc(sizeof(*lavc_venc_context->intra_matrix)*64);
+ av_malloc(sizeof(*lavc_venc_context->intra_matrix)*64);
i = 0;
while ((tmp = strsep(&lavc_param_intra_matrix, ",")) && (i < 64))
@@ -448,10 +448,7 @@ static int config(struct vf_instance_s* vf,
}
if (i != 64)
- {
- free(lavc_venc_context->intra_matrix);
- lavc_venc_context->intra_matrix = NULL;
- }
+ av_freep(&lavc_venc_context->intra_matrix);
else
mp_msg(MSGT_MENCODER, MSGL_V, "Using user specified intra matrix\n");
}
@@ -460,7 +457,7 @@ static int config(struct vf_instance_s* vf,
char *tmp;
lavc_venc_context->inter_matrix =
- malloc(sizeof(*lavc_venc_context->inter_matrix)*64);
+ av_malloc(sizeof(*lavc_venc_context->inter_matrix)*64);
i = 0;
while ((tmp = strsep(&lavc_param_inter_matrix, ",")) && (i < 64))
@@ -471,10 +468,7 @@ static int config(struct vf_instance_s* vf,
}
if (i != 64)
- {
- free(lavc_venc_context->inter_matrix);
- lavc_venc_context->inter_matrix = NULL;
- }
+ av_freep(&lavc_venc_context->inter_matrix);
else
mp_msg(MSGT_MENCODER, MSGL_V, "Using user specified inter matrix\n");
}
@@ -652,7 +646,7 @@ static int config(struct vf_instance_s* vf,
size= ftell(stats_file);
fseek(stats_file, 0, SEEK_SET);
- lavc_venc_context->stats_in= malloc(size + 1);
+ lavc_venc_context->stats_in= av_malloc(size + 1);
lavc_venc_context->stats_in[size]=0;
if(fread(lavc_venc_context->stats_in, size, 1, stats_file)<1){
@@ -728,8 +722,7 @@ static int config(struct vf_instance_s* vf,
}
/* free second pass buffer, its not needed anymore */
- if(lavc_venc_context->stats_in) free(lavc_venc_context->stats_in);
- lavc_venc_context->stats_in= NULL;
+ av_freep(&lavc_venc_context->stats_in);
if(lavc_venc_context->bits_per_sample)
mux_v->bih->biBitCount= lavc_venc_context->bits_per_sample;
if(lavc_venc_context->extradata_size){
@@ -907,12 +900,8 @@ static void uninit(struct vf_instance_s* vf){
#endif
#if LIBAVCODEC_BUILD >= 4675
- if (lavc_venc_context->intra_matrix)
- free(lavc_venc_context->intra_matrix);
- lavc_venc_context->intra_matrix = NULL;
- if (lavc_venc_context->inter_matrix)
- free(lavc_venc_context->inter_matrix);
- lavc_venc_context->inter_matrix = NULL;
+ av_freep(&lavc_venc_context->intra_matrix);
+ av_freep(&lavc_venc_context->inter_matrix);
#endif
avcodec_close(lavc_venc_context);
@@ -920,11 +909,9 @@ static void uninit(struct vf_instance_s* vf){
if(stats_file) fclose(stats_file);
/* free rc_override */
- if(lavc_venc_context->rc_override) free(lavc_venc_context->rc_override);
- lavc_venc_context->rc_override= NULL;
+ av_freep(&lavc_venc_context->rc_override);
- if(vf->priv->context) free(vf->priv->context);
- vf->priv->context= NULL;
+ av_freep(&vf->priv->context);
}
//===========================================================================//