diff options
Diffstat (limited to 'src/video_dec')
-rw-r--r-- | src/video_dec/gdkpixbuf.c | 2 | ||||
-rw-r--r-- | src/video_dec/image.c | 2 | ||||
-rw-r--r-- | src/video_dec/libmpeg2/Makefile.am | 2 | ||||
-rw-r--r-- | src/video_dec/libmpeg2/header.c | 14 | ||||
-rw-r--r-- | src/video_dec/libmpeg2/mpeg2_internal.h | 4 | ||||
-rw-r--r-- | src/video_dec/libmpeg2/xine_mpeg2_decoder.c | 2 |
6 files changed, 17 insertions, 9 deletions
diff --git a/src/video_dec/gdkpixbuf.c b/src/video_dec/gdkpixbuf.c index 28c9c77c7..34644241d 100644 --- a/src/video_dec/gdkpixbuf.c +++ b/src/video_dec/gdkpixbuf.c @@ -280,7 +280,7 @@ static void *init_class (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t supported_types[] = { BUF_VIDEO_IMAGE, BUF_VIDEO_JPEG, 0 }; +static const uint32_t supported_types[] = { BUF_VIDEO_IMAGE, BUF_VIDEO_JPEG, 0 }; static const decoder_info_t dec_info_image = { supported_types, /* supported types */ diff --git a/src/video_dec/image.c b/src/video_dec/image.c index e84312624..5c8439a67 100644 --- a/src/video_dec/image.c +++ b/src/video_dec/image.c @@ -258,7 +258,7 @@ static void *init_class (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t supported_types[] = { BUF_VIDEO_IMAGE, +static const uint32_t supported_types[] = { BUF_VIDEO_IMAGE, 0 }; static const decoder_info_t dec_info_image = { diff --git a/src/video_dec/libmpeg2/Makefile.am b/src/video_dec/libmpeg2/Makefile.am index 257c8405a..06b9ef8ff 100644 --- a/src/video_dec/libmpeg2/Makefile.am +++ b/src/video_dec/libmpeg2/Makefile.am @@ -28,5 +28,5 @@ xineplug_decode_mpeg2_la_SOURCES = \ xine_mpeg2_decoder.c \ libmpeg2_accel.c -xineplug_decode_mpeg2_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) $(AVUTIL_LIBS) -lm +xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) $(AVUTIL_LIBS) -lm xineplug_decode_mpeg2_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS) $(AVUTIL_CFLAGS) diff --git a/src/video_dec/libmpeg2/header.c b/src/video_dec/libmpeg2/header.c index 12ba0ff8a..0c2b76891 100644 --- a/src/video_dec/libmpeg2/header.c +++ b/src/video_dec/libmpeg2/header.c @@ -101,6 +101,14 @@ static uint32_t get_bits(uint8_t *buffer, uint32_t count, uint32_t *bit_position return result; } +static int32_t get_bits_signed(uint8_t *buffer, uint32_t count, uint32_t *bit_position) { + uint32_t value = get_bits(buffer, count, bit_position); + uint32_t sign_mask = (uint32_t)(-1 << (count - 1)); + if (value & sign_mask) + value |= sign_mask; /* sign-extend value */ + return (int32_t)value; +} + void mpeg2_header_state_init (picture_t * picture) { picture->scan = mpeg2_scan_norm; @@ -291,13 +299,13 @@ static int picture_display_extension (picture_t * picture, uint8_t * buffer) { bit_position = 0; padding = get_bits(buffer, 4, &bit_position); - picture->frame_centre_horizontal_offset = get_bits(buffer, 16, &bit_position); + picture->frame_centre_horizontal_offset = get_bits_signed(buffer, 16, &bit_position); padding = get_bits(buffer, 1, &bit_position); - picture->frame_centre_vertical_offset = get_bits(buffer, 16, &bit_position); + picture->frame_centre_vertical_offset = get_bits_signed(buffer, 16, &bit_position); padding = get_bits(buffer, 1, &bit_position); #ifdef LOG_PAN_SCAN - printf("Pan & Scan centre (x,y) = (%u, %u)\n", + printf("Pan & Scan centre (x,y) = (%d, %d)\n", picture->frame_centre_horizontal_offset, picture->frame_centre_vertical_offset); #endif diff --git a/src/video_dec/libmpeg2/mpeg2_internal.h b/src/video_dec/libmpeg2/mpeg2_internal.h index 2e42aace6..eeaa16227 100644 --- a/src/video_dec/libmpeg2/mpeg2_internal.h +++ b/src/video_dec/libmpeg2/mpeg2_internal.h @@ -177,8 +177,8 @@ typedef struct picture_s { int progressive_sequence; int repeat_first_field; int progressive_frame; - uint32_t frame_centre_horizontal_offset; - uint32_t frame_centre_vertical_offset; + int32_t frame_centre_horizontal_offset; + int32_t frame_centre_vertical_offset; uint32_t video_format; uint32_t colour_description; uint32_t colour_primatives; diff --git a/src/video_dec/libmpeg2/xine_mpeg2_decoder.c b/src/video_dec/libmpeg2/xine_mpeg2_decoder.c index 3a3e28452..fc8bd4dc2 100644 --- a/src/video_dec/libmpeg2/xine_mpeg2_decoder.c +++ b/src/video_dec/libmpeg2/xine_mpeg2_decoder.c @@ -155,7 +155,7 @@ static void *init_plugin (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 }; +static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 }; static const decoder_info_t dec_info_mpeg2 = { supported_types, /* supported types */ |