FFV1Context *s = avctx->priv_data;
int i;
- if(avctx->strict_std_compliance >FF_COMPLIANCE_EXPERIMENTAL){
- av_log(avctx, AV_LOG_ERROR, "this codec is under development, files encoded with it may not be decodeable with future versions!!!\n"
- "use vstrict=-2 / -strict -2 to use it anyway\n");
- return -1;
- }
-
common_init(avctx);
s->version=0;
}
}
-static void common_end(FFV1Context *s){
+static int common_end(AVCodecContext *avctx){
+ FFV1Context *s = avctx->priv_data;
int i;
for(i=0; i<s->plane_count; i++){
av_freep(&p->state);
}
-}
-
-static int encode_end(AVCodecContext *avctx)
-{
- FFV1Context *s = avctx->priv_data;
-
- common_end(s);
return 0;
}
p->pict_type= FF_I_TYPE; //FIXME I vs. P
if(get_rac(c, &keystate)){
p->key_frame= 1;
- read_header(f);
+ if(read_header(f) < 0)
+ return -1;
clear_state(f);
}else{
p->key_frame= 0;
}
+ if(!f->plane[0].state && !f->plane[0].vlc_state)
+ return -1;
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
sizeof(FFV1Context),
decode_init,
NULL,
- NULL,
+ common_end,
decode_frame,
CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
NULL
sizeof(FFV1Context),
encode_init,
encode_frame,
- encode_end,
+ common_end,
};
#endif