ffmpeg/set_encoder_id: dont allocate encoder string if one is already set
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 19 May 2014 22:50:27 +0000 (00:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 19 May 2014 22:51:47 +0000 (00:51 +0200)
Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 7ec5889..eafcf0f 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2377,6 +2377,9 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost)
     int format_flags = 0;
     int codec_flags = 0;
 
+    if (av_dict_get(ost->st->metadata, "encoder",  NULL, 0))
+        return;
+
     e = av_dict_get(of->opts, "fflags", NULL, 0);
     if (e) {
         const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0);