# HG changeset patch # User banan # Date 1173518407 0 # Node ID 414d484f6483f3ba8770a568c613a509c6ff81a5 # Parent 1e175640dad3ad4c374b4dd0b74fd137c6210969 Simplify, use avctx->frame_number. diff -r 1e175640dad3 -r 414d484f6483 flashsvenc.c --- a/flashsvenc.c Fri Mar 09 13:57:42 2007 +0000 +++ b/flashsvenc.c Sat Mar 10 09:20:07 2007 +0000 @@ -68,7 +68,6 @@ AVCodecContext *avctx; uint8_t *previous_frame; AVFrame frame; - int first_frame; int image_width, image_height; int block_width, block_height; uint8_t* tmpblock; @@ -113,8 +112,6 @@ return -1; } - s->first_frame = 1; - // Needed if zlib unused or init aborted before deflateInit memset(&(s->zstream), 0, sizeof(z_stream)); /* @@ -241,14 +238,13 @@ *p = *pict; - if (s->first_frame) { + if (avctx->frame_number == 0) { s->previous_frame = av_mallocz(p->linesize[0]*s->image_height); if (!s->previous_frame) { av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); return -1; } I_frame = 1; - s->first_frame = 0; } #if 0