Commit 78ba1137 authored by banan's avatar banan

Simplify, use avctx->frame_number.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8309 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6de07118
...@@ -68,7 +68,6 @@ typedef struct FlashSVContext { ...@@ -68,7 +68,6 @@ typedef struct FlashSVContext {
AVCodecContext *avctx; AVCodecContext *avctx;
uint8_t *previous_frame; uint8_t *previous_frame;
AVFrame frame; AVFrame frame;
int first_frame;
int image_width, image_height; int image_width, image_height;
int block_width, block_height; int block_width, block_height;
uint8_t* tmpblock; uint8_t* tmpblock;
...@@ -113,8 +112,6 @@ static int flashsv_encode_init(AVCodecContext *avctx) ...@@ -113,8 +112,6 @@ static int flashsv_encode_init(AVCodecContext *avctx)
return -1; return -1;
} }
s->first_frame = 1;
// Needed if zlib unused or init aborted before deflateInit // Needed if zlib unused or init aborted before deflateInit
memset(&(s->zstream), 0, sizeof(z_stream)); memset(&(s->zstream), 0, sizeof(z_stream));
/* /*
...@@ -241,14 +238,13 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz ...@@ -241,14 +238,13 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz
*p = *pict; *p = *pict;
if (s->first_frame) { if (avctx->frame_number == 0) {
s->previous_frame = av_mallocz(p->linesize[0]*s->image_height); s->previous_frame = av_mallocz(p->linesize[0]*s->image_height);
if (!s->previous_frame) { if (!s->previous_frame) {
av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
return -1; return -1;
} }
I_frame = 1; I_frame = 1;
s->first_frame = 0;
} }
#if 0 #if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment