10l (returning negative number of consumed bytes if the first startcode of a frame was split between 2 buffers)
Originally committed as revision 1824 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -2190,7 +2190,7 @@ static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
|
||||
}
|
||||
}
|
||||
pc->state= state;
|
||||
return -1;
|
||||
return END_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* handle buffering and image synchronisation */
|
||||
@@ -2218,9 +2218,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if(s2->flags&CODEC_FLAG_TRUNCATED){
|
||||
int next;
|
||||
|
||||
next= mpeg1_find_frame_end(s2, buf, buf_size);
|
||||
int next= mpeg1_find_frame_end(s2, buf, buf_size);
|
||||
|
||||
if( ff_combine_frame(s2, next, &buf, &buf_size) < 0 )
|
||||
return buf_size;
|
||||
@@ -2288,7 +2286,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
|
||||
if (ret == DECODE_SLICE_EOP) {
|
||||
if(s2->last_picture_ptr) //FIXME merge with the stuff in mpeg_decode_slice
|
||||
*data_size = sizeof(AVPicture);
|
||||
return FFMAX(1, buf_ptr - buf - s2->parse_context.last_index);
|
||||
return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
|
||||
}else if(ret < 0){
|
||||
if(ret == DECODE_SLICE_ERROR)
|
||||
ff_er_add_slice(s2, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x, s2->mb_y, AC_ERROR|DC_ERROR|MV_ERROR);
|
||||
|
Reference in New Issue
Block a user