fixing files where the first frame isn a keyframe
Originally committed as revision 1309 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -801,7 +801,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
alloc:
|
||||||
if(!s->encoding){
|
if(!s->encoding){
|
||||||
/* find unused Picture */
|
/* find unused Picture */
|
||||||
for(i=0; i<MAX_PICTURE_COUNT; i++){
|
for(i=0; i<MAX_PICTURE_COUNT; i++){
|
||||||
@ -829,14 +829,20 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
|||||||
s->current_picture= s->picture[i];
|
s->current_picture= s->picture[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
s->hurry_up= s->avctx->hurry_up;
|
|
||||||
s->error_resilience= avctx->error_resilience;
|
|
||||||
|
|
||||||
if (s->pict_type != B_TYPE) {
|
if (s->pict_type != B_TYPE) {
|
||||||
s->last_picture= s->next_picture;
|
s->last_picture= s->next_picture;
|
||||||
s->next_picture= s->current_picture;
|
s->next_picture= s->current_picture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(s->pict_type != I_TYPE && s->last_picture.data[0]==NULL){
|
||||||
|
fprintf(stderr, "warning: first frame is no keyframe\n");
|
||||||
|
assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference
|
||||||
|
goto alloc;
|
||||||
|
}
|
||||||
|
|
||||||
|
s->hurry_up= s->avctx->hurry_up;
|
||||||
|
s->error_resilience= avctx->error_resilience;
|
||||||
|
|
||||||
/* set dequantizer, we cant do it during init as it might change for mpeg4
|
/* set dequantizer, we cant do it during init as it might change for mpeg4
|
||||||
and we cant do it in the header decode as init isnt called for mpeg4 there yet */
|
and we cant do it in the header decode as init isnt called for mpeg4 there yet */
|
||||||
if(s->out_format == FMT_H263){
|
if(s->out_format == FMT_H263){
|
||||||
|
Reference in New Issue
Block a user