summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-04-03 23:13:34 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-04-03 23:13:34 +0000
commit0a80205c3ff4549cd450b675541c69f8b3f40316 (patch)
tree52ebaf6d5aa588a4123462f7c40f531a30eba781 /src
parent88285568437cd829b87bab704f8e2bf4573c7748 (diff)
downloadxine-lib-0a80205c3ff4549cd450b675541c69f8b3f40316.tar.gz
xine-lib-0a80205c3ff4549cd450b675541c69f8b3f40316.tar.bz2
implement Michel's suggestion to detect finished frames.
CVS patchset: 1670 CVS date: 2002/04/03 23:13:34
Diffstat (limited to 'src')
-rw-r--r--src/libmpeg2/decode.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index d94382e44..d74be2b10 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -390,7 +390,8 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
}
if (!(mpeg2dec->drop_frame)) {
- mpeg2_slice (picture, code, buffer);
+ mpeg2_slice (picture, code, buffer);
+ if( picture->v_offset > picture->limit_y )
picture->current_frame->bad_frame = 0;
}
}
@@ -475,19 +476,15 @@ void mpeg2_flush (mpeg2dec_t * mpeg2dec) {
if (!picture)
return;
- /* we use drawn = 2 here as a special case: the frame can be flushed
- * more than once (thus fixing the problem of blasting unfinished
- * frames).
- */
- if (picture->current_frame && picture->current_frame->drawn != 1
- && !picture->current_frame->bad_frame) {
+ if (picture->current_frame && !picture->current_frame->drawn &&
+ !picture->current_frame->bad_frame) {
vo_frame_t *img;
printf ("libmpeg2: blasting out current frame %d on flush\n",
picture->current_frame->id);
- picture->current_frame->drawn = 2;
+ picture->current_frame->drawn = 1;
/* output a copy instead of the frame used by decoder */
img = picture->current_frame->instance->duplicate_frame(picture->current_frame->instance,