diff options
author | Ewald Snel <esnel@users.sourceforge.net> | 2003-02-26 06:49:23 +0000 |
---|---|---|
committer | Ewald Snel <esnel@users.sourceforge.net> | 2003-02-26 06:49:23 +0000 |
commit | 2a5db04fc3570292d6cbbaf657cb093bff8d9e5f (patch) | |
tree | 1e84bd6fc7986c9afffc320e508e614097ec7f6f /src/libmpeg2/decode.c | |
parent | f713694f86c77a076658a3a58c2327db7ea67a2c (diff) | |
download | xine-lib-2a5db04fc3570292d6cbbaf657cb093bff8d9e5f.tar.gz xine-lib-2a5db04fc3570292d6cbbaf657cb093bff8d9e5f.tar.bz2 |
Fix blockiness after seeking MPEG-2 streams
CVS patchset: 4287
CVS date: 2003/02/26 06:49:23
Diffstat (limited to 'src/libmpeg2/decode.c')
-rw-r--r-- | src/libmpeg2/decode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 0e511fc77..f1ee8a14c 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -72,6 +72,7 @@ void mpeg2_init (mpeg2dec_t * mpeg2dec) mpeg2dec->shift = 0xffffff00; mpeg2dec->is_sequence_needed = 1; + mpeg2dec->is_wait_for_ip_frames = 2; mpeg2dec->frames_to_drop = 0; mpeg2dec->drop_frame = 0; mpeg2dec->in_slice = 0; @@ -248,8 +249,13 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, if (((picture->picture_structure == FRAME_PICTURE) || (picture->second_field)) ) { - if (mpeg2dec->drop_frame) + if (mpeg2dec->drop_frame || + (picture->picture_coding_type == B_TYPE && mpeg2dec->is_wait_for_ip_frames > 0) || + (picture->picture_coding_type == P_TYPE && mpeg2dec->is_wait_for_ip_frames > 1)) { picture->current_frame->bad_frame = 1; + } else if (picture->picture_coding_type != D_TYPE && mpeg2dec->is_wait_for_ip_frames > 0) { + mpeg2dec->is_wait_for_ip_frames--; + } if (picture->picture_coding_type == B_TYPE) { if( picture->current_frame && !picture->current_frame->drawn ) { @@ -589,7 +595,7 @@ void mpeg2_reset (mpeg2dec_t * mpeg2dec) { mpeg2_discontinuity(mpeg2dec); if( !picture->mpeg1 ) - mpeg2dec->is_sequence_needed = 1; + mpeg2dec->is_wait_for_ip_frames = 2; else { /* to free reference frames one also needs to fix slice.c to * abort when they are NULL. unfortunately it seems to break |