diff options
author | Heiko Schaefer <heikos@users.sourceforge.net> | 2002-07-28 15:23:31 +0000 |
---|---|---|
committer | Heiko Schaefer <heikos@users.sourceforge.net> | 2002-07-28 15:23:31 +0000 |
commit | ed6a7497f05489bbda80513ea97f269650c54099 (patch) | |
tree | 44d9d6dad2793aaff97ca5129a86ff11b36ad43c | |
parent | a1b83c86fbea6291e41a72791f1163d7e9683ff6 (diff) | |
download | xine-lib-ed6a7497f05489bbda80513ea97f269650c54099.tar.gz xine-lib-ed6a7497f05489bbda80513ea97f269650c54099.tar.bz2 |
attempt to fix seeking artefacts for mpeg-1 streams
CVS patchset: 2359
CVS date: 2002/07/28 15:23:31
-rw-r--r-- | src/libmpeg2/decode.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index df5b824a5..39683a5eb 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -494,30 +494,32 @@ void mpeg2_reset (mpeg2dec_t * mpeg2dec) { mpeg2dec->pts = 0; - if( !picture->mpeg1 ) + if( !picture->mpeg1 ) mpeg2dec->is_sequence_needed = 1; + else { + /* to free reference frames one also needs to fix slice.c to + * abort when they are NULL. unfortunately it seems to break + * DVD menus. + * + * ...so let's do this for mpeg-1 only :) + */ + if ( picture->current_frame && + picture->current_frame != picture->backward_reference_frame && + picture->current_frame != picture->forward_reference_frame ) + picture->current_frame->free (picture->current_frame); + picture->current_frame = NULL; + + if (picture->forward_reference_frame) + picture->forward_reference_frame->free (picture->forward_reference_frame); + picture->forward_reference_frame = NULL; + + if (picture->backward_reference_frame) + picture->backward_reference_frame->free (picture->backward_reference_frame); + picture->backward_reference_frame = NULL; + } mpeg2dec->in_slice = 0; - /* to free reference frames one also needs to fix slice.c to - * abort when they are NULL. unfortunately it seems to break - * DVD menus. - */ - /* - if ( picture->current_frame && - picture->current_frame != picture->backward_reference_frame && - picture->current_frame != picture->forward_reference_frame ) - picture->current_frame->free (picture->current_frame); - picture->current_frame = NULL; - - if (picture->forward_reference_frame) - picture->forward_reference_frame->free (picture->forward_reference_frame); - picture->forward_reference_frame = NULL; - - if (picture->backward_reference_frame) - picture->backward_reference_frame->free (picture->backward_reference_frame); - picture->backward_reference_frame = NULL; - */ } /* flush must never allocate any frame (get_frame/duplicate_frame). |