Only allocate stats_out when needed in ffv1

Originally committed as revision 25579 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2010-10-26 23:01:00 +00:00
parent 2a317c6be4
commit c42c1007c7
1 changed files with 2 additions and 1 deletions

View File

@ -945,6 +945,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1; return -1;
#define STATS_OUT_SIZE 1024*30 #define STATS_OUT_SIZE 1024*30
if(avctx->flags & CODEC_FLAG_PASS1)
avctx->stats_out= av_mallocz(STATS_OUT_SIZE); avctx->stats_out= av_mallocz(STATS_OUT_SIZE);
return 0; return 0;
@ -1099,7 +1100,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
p+= strlen(p); p+= strlen(p);
} }
snprintf(p, end-p, "\n"); snprintf(p, end-p, "\n");
} else } else if(avctx->flags&CODEC_FLAG_PASS1)
avctx->stats_out[0] = '\0'; avctx->stats_out[0] = '\0';
f->picture_number++; f->picture_number++;