diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-05 21:40:37 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-05 21:40:37 +0000 |
commit | 02d538ae2b4a1f28f0359ce68b09fe016f47df91 (patch) | |
tree | bee6562604c7b7e474c373d8aafa5ba26dfb9779 | |
parent | cf52426c02f434399e05afb85e2b739632f19ec9 (diff) | |
download | xine-lib-02d538ae2b4a1f28f0359ce68b09fe016f47df91.tar.gz xine-lib-02d538ae2b4a1f28f0359ce68b09fe016f47df91.tar.bz2 |
fix decoding of dolbydigitaltemple stream
CVS patchset: 3794
CVS date: 2003/01/05 21:40:37
-rw-r--r-- | src/libmpeg2/decode.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index cfe387f33..f70c6b573 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -239,8 +239,10 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, picture = mpeg2dec->picture; is_frame_done = mpeg2dec->in_slice && ((!code) || (code >= 0xb0)); - if (is_frame_done && picture->current_frame != NULL) { + if (is_frame_done) mpeg2dec->in_slice = 0; + + if (is_frame_done && picture->current_frame != NULL) { if (((picture->picture_structure == FRAME_PICTURE) || (picture->second_field)) ) { @@ -330,10 +332,10 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, } else if (!picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) { mpeg2dec->drop_frame = 1; #ifdef LOG - if (picture->backward_reference_frame->bad_frame) - printf ("libmpeg2: dropping p-frame because ref %d is bad\n", picture->backward_reference_frame->id); - else + if (!picture->backward_reference_frame) printf ("libmpeg2: dropping p-frame because no ref frame\n"); + else + printf ("libmpeg2: dropping p-frame because ref %d is bad\n", picture->backward_reference_frame->id); #endif } break; @@ -423,7 +425,7 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, if (!(mpeg2dec->in_slice)) { mpeg2dec->in_slice = 1; - + if (picture->second_field) { if (picture->current_frame) picture->current_frame->field(picture->current_frame, @@ -478,8 +480,13 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, if (!mpeg2dec->drop_frame && picture->current_frame != NULL) { mpeg2_slice (picture, code, buffer); - if( picture->v_offset > picture->limit_y ) + + if( picture->v_offset > picture->limit_y ) { picture->current_frame->bad_frame = 0; +#ifdef LOG + printf("libmpeg2: frame %d successfuly decoded\n",picture->current_frame->id); +#endif + } } } |