From a213a237d17cd0fb00611fe56380a94e3b675638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Date: Sat, 13 Nov 2004 19:32:51 +0000 Subject: Fixed segfault when seeking with the "xvmc" and "xxmc" plugins playing files with IDCT / mocomp XvMC acceleration. Cleaned up some ugly xvmc / xxmc naming. CVS patchset: 7122 CVS date: 2004/11/13 19:32:51 --- src/libmpeg2/slice_xvmc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libmpeg2/slice_xvmc.c') diff --git a/src/libmpeg2/slice_xvmc.c b/src/libmpeg2/slice_xvmc.c index 1f6176e78..c4d2a5ff0 100644 --- a/src/libmpeg2/slice_xvmc.c +++ b/src/libmpeg2/slice_xvmc.c @@ -35,6 +35,8 @@ #include "attributes.h" #include "accel_xvmc.h" +#include "xvmc.h" + #define MOTION_ACCEL XINE_VO_MOTION_ACCEL #define IDCT_ACCEL XINE_VO_IDCT_ACCEL @@ -1694,7 +1696,7 @@ static inline int slice_xvmc_init (picture_t * picture, int code) #undef bit_ptr } -void mpeg2_xvmc_slice (picture_t * picture, int code, uint8_t * buffer) +void mpeg2_xvmc_slice (mpeg2dec_t *mpeg2dec, picture_t * picture, int code, uint8_t * buffer) { #define bit_buf (picture->bitstream_buf) #define bits (picture->bitstream_bits) @@ -1702,6 +1704,12 @@ void mpeg2_xvmc_slice (picture_t * picture, int code, uint8_t * buffer) cpu_state_t cpu_state; xine_xvmc_t *xvmc = (xine_xvmc_t *) picture->current_frame->accel_data; + if (1 == code) { + mpeg2dec->xvmc_last_slice_code = 0; + } + if (code != mpeg2dec->xvmc_last_slice_code + 1) + return; + bitstream_init (picture, buffer); if (slice_xvmc_init (picture, code)) @@ -1928,6 +1936,7 @@ void mpeg2_xvmc_slice (picture_t * picture, int code, uint8_t * buffer) default: /* end of slice, or error */ if (mpeg2_cpu_state_restore) mpeg2_cpu_state_restore (&cpu_state); + mpeg2dec->xvmc_last_slice_code++; return; } } @@ -2027,6 +2036,7 @@ void mpeg2_xvmc_slice (picture_t * picture, int code, uint8_t * buffer) } } } + mpeg2dec->xvmc_last_slice_code++; #undef bit_buf #undef bits #undef bit_ptr -- cgit v1.2.3