aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-04-27 01:11:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-04-27 01:11:26 +0000
commitbb463d81020a2f3c5cf3403e18f980171773f48a (patch)
tree3d6c5aacdf0a24c53079e9191783421e5a939a87 /libavcodec/mpeg12.c
parent7c9375f15a730c783f0822960c3cc2c6f90e70c8 (diff)
downloadffmpeg-bb463d81020a2f3c5cf3403e18f980171773f48a.tar.gz
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
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index d16eaa1da6..d3cef315e4 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -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);