diff options
author | Thomas Hellström <totte67@users.sourceforge.net> | 2005-05-03 19:25:10 +0000 |
---|---|---|
committer | Thomas Hellström <totte67@users.sourceforge.net> | 2005-05-03 19:25:10 +0000 |
commit | 1daa2c4132617848de05b492beaf05d428f27ccc (patch) | |
tree | 01a8e1133c64b2fdb3b326c1f7f94589632149bd /src/libmpeg2/libmpeg2_accel.c | |
parent | 746d3bb3ba53bc8c4b3931277934035b3c345b79 (diff) | |
download | xine-lib-1daa2c4132617848de05b492beaf05d428f27ccc.tar.gz xine-lib-1daa2c4132617848de05b492beaf05d428f27ccc.tar.bz2 |
**BUGFIX**
Fixed xvmc plugin segfault when it tried software blending on nonexistant xv image.
Cleaned up libmpeg2 behaviour on xxmc plugin abrupt software fallback.
CVS patchset: 7516
CVS date: 2005/05/03 19:25:10
Diffstat (limited to 'src/libmpeg2/libmpeg2_accel.c')
-rw-r--r-- | src/libmpeg2/libmpeg2_accel.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/libmpeg2/libmpeg2_accel.c b/src/libmpeg2/libmpeg2_accel.c index 9d30e2b75..51e0b8b73 100644 --- a/src/libmpeg2/libmpeg2_accel.c +++ b/src/libmpeg2/libmpeg2_accel.c @@ -75,7 +75,7 @@ libmpeg2_accel_new_sequence(mpeg2dec_accel_t *accel, uint32_t frame_format, pict int libmpeg2_accel_new_frame(mpeg2dec_accel_t *accel, uint32_t frame_format, - picture_t *picture, double ratio) + picture_t *picture, double ratio, uint32_t flags) { if (picture->current_frame) { if (XINE_IMGFMT_XXMC == frame_format) { @@ -98,7 +98,7 @@ libmpeg2_accel_new_frame(mpeg2dec_accel_t *accel, uint32_t frame_format, */ if ( picture->picture_structure != 3 ) { - xxmc->acceleration &= ~( XINE_XVMC_ACCEL_IDCT | XINE_XVMC_ACCEL_MOCOMP ); + xxmc->acceleration &= ~( /* XINE_XVMC_ACCEL_IDCT | */ XINE_XVMC_ACCEL_MOCOMP ); } xxmc->mpeg = (picture->mpeg1) ? XINE_XVMC_MPEG_1:XINE_XVMC_MPEG_2; @@ -107,7 +107,7 @@ libmpeg2_accel_new_frame(mpeg2dec_accel_t *accel, uint32_t frame_format, picture->coded_picture_width, picture->coded_picture_height, ratio, - XINE_IMGFMT_XXMC, picture->picture_structure); + XINE_IMGFMT_XXMC, flags); } } return 0; @@ -150,6 +150,29 @@ int libmpeg2_accel_slice(mpeg2dec_accel_t *accel, uint32_t frame_format, picture_t *picture, int code, char * buffer, uint32_t chunk_size, uint8_t *chunk_buffer) { + /* + * Don't reference frames of other formats. They are invalid. This may happen if the + * xxmc plugin suddenly falls back to software decoding. + */ + + if (( picture->current_frame->picture_coding_type == XINE_PICT_P_TYPE ) || + ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE )) { + if (! picture->forward_reference_frame) return 1; + if (picture->forward_reference_frame->format != picture->current_frame->format) { + picture->v_offset = 0; + return 1; + } + } + + if ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE ) { + if (! picture->backward_reference_frame) return 1; + if (picture->backward_reference_frame->format != picture->current_frame->format) { + picture->v_offset = 0; + return 1; + } + } + + switch( frame_format ) { case XINE_IMGFMT_XXMC: { |