[FFmpeg-cvslog] r14788 - in trunk: libavcodec/ratecontrol.c libavcodec/utils.c libavformat/ffmenc.c
michael
subversion
Sat Aug 16 16:46:32 CEST 2008
Author: michael
Date: Sat Aug 16 16:46:31 2008
New Revision: 14788
Log:
Fix rc_eq mem leak.
Modified:
trunk/libavcodec/ratecontrol.c
trunk/libavcodec/utils.c
trunk/libavformat/ffmenc.c
Modified: trunk/libavcodec/ratecontrol.c
==============================================================================
--- trunk/libavcodec/ratecontrol.c (original)
+++ trunk/libavcodec/ratecontrol.c Sat Aug 16 16:46:31 2008
@@ -106,7 +106,7 @@ int ff_rate_control_init(MpegEncContext
};
emms_c();
- rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq, const_names, func1, func1_names, NULL, NULL, &error);
+ rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq ? s->avctx->rc_eq : "tex^qComp", const_names, func1, func1_names, NULL, NULL, &error);
if (!rcc->rc_eq_eval) {
av_log(s->avctx, AV_LOG_ERROR, "Error parsing rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
return -1;
Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c (original)
+++ trunk/libavcodec/utils.c Sat Aug 16 16:46:31 2008
@@ -762,7 +762,6 @@ void avcodec_get_context_defaults2(AVCod
flags= AV_OPT_FLAG_SUBTITLE_PARAM;
av_opt_set_defaults2(s, flags, flags);
- s->rc_eq= av_strdup("tex^qComp");
s->time_base= (AVRational){0,1};
s->get_buffer= avcodec_default_get_buffer;
s->release_buffer= avcodec_default_release_buffer;
Modified: trunk/libavformat/ffmenc.c
==============================================================================
--- trunk/libavformat/ffmenc.c (original)
+++ trunk/libavformat/ffmenc.c Sat Aug 16 16:46:31 2008
@@ -132,7 +132,7 @@ static int ffm_write_header(AVFormatCont
put_be16(pb, (int) (codec->qcompress * 10000.0));
put_be16(pb, (int) (codec->qblur * 10000.0));
put_be32(pb, codec->bit_rate_tolerance);
- put_strz(pb, codec->rc_eq);
+ put_strz(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
put_be32(pb, codec->rc_max_rate);
put_be32(pb, codec->rc_min_rate);
put_be32(pb, codec->rc_buffer_size);
More information about the ffmpeg-cvslog
mailing list