From fc97fb46d693697ef65f008f7a38a3797599e4cb Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 15 Dec 2011 23:28:25 +0200 Subject: Fixed printf format --HG-- branch : point-release --- src/video_out/video_out_xv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 1404871d4..af1752158 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1429,8 +1429,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * if (xv_port != 0) { if (! xv_open_port(this, xv_port)) { xprintf(class->xine, XINE_VERBOSITY_NONE, - _("%s: could not open Xv port %"PRId32" - autodetecting\n"), - LOG_MODULE, xv_port); + _("%s: could not open Xv port %lu - autodetecting\n"), + LOG_MODULE, (unsigned long)xv_port); xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port, prefer_type); } else adaptor_num = xv_find_adaptor_by_port (xv_port, adaptors, adaptor_info); -- cgit v1.2.3 From 556e616af4d6b97a40e5b4a1d0dbf56a956b6a3c Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 15 Dec 2011 23:29:50 +0200 Subject: xvmc: Fixed using uninitialized data and resource leak (from 9456) --HG-- branch : point-release --- src/video_out/video_out_xvmc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 16d87c6b0..f06f0cf3f 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -226,6 +226,8 @@ typedef struct { Display *display; config_values_t *config; XvPortID xv_port; + XvAdaptorInfo *adaptor_info; + unsigned int adaptor_num; int surface_type_id; unsigned int max_surface_width; @@ -1345,8 +1347,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi int nattr; x11_visual_t *visual = (x11_visual_t *) visual_gen; XColor dummy; - XvAdaptorInfo *adaptor_info; - unsigned int adaptor_num; + XvAdaptorInfo *adaptor_info = class->adaptor_info; + unsigned int adaptor_num = class->adaptor_num; /* XvImage *myimage; */ lprintf ("open_plugin\n"); @@ -1611,6 +1613,10 @@ static char* get_description (video_driver_class_t *this_gen) { static void dispose_class (video_driver_class_t *this_gen) { xvmc_class_t *this = (xvmc_class_t *) this_gen; + XLockDisplay(this->display); + XvFreeAdaptorInfo (this->adaptor_info); + XUnlockDisplay(this->display); + free (this); } @@ -1783,6 +1789,8 @@ static void *init_class (xine_t *xine, void *visual_gen) { this->display = display; this->config = xine->config; this->xv_port = xv_port; + this->adaptor_info = adaptor_info; + this->adaptor_num = adaptor_num; this->surface_type_id = surface_type; this->max_surface_width = max_width; this->max_surface_height = max_height; -- cgit v1.2.3 From 80223ca937303c9183e17b5c032bf4791ddbc96a Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 15 Dec 2011 23:34:51 +0200 Subject: Fixed printf format --HG-- branch : point-release --- src/video_out/video_out_xxmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 6529d5832..f8caec755 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -2458,8 +2458,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi if (xv_port != 0) { if (! xxmc_open_port(this, xv_port)) { xprintf(class->xine, XINE_VERBOSITY_NONE, - _("%s: could not open Xv port %d - autodetecting\n"), - LOG_MODULE, xv_port); + _("%s: could not open Xv port %lu - autodetecting\n"), + LOG_MODULE, (unsigned long)xv_port); xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port, prefer_type); } else adaptor_num = xxmc_find_adaptor_by_port (xv_port, adaptors, adaptor_info); -- cgit v1.2.3 From 752d2e3f572bf5c6fa6088c4e3966a35241d14de Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 00:03:41 +0200 Subject: Added missing const --HG-- branch : point-release --- src/video_out/video_out_xcbxv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index f1ff843dc..78bbc94e6 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1011,7 +1011,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, return 0; } -static void xv_store_port_attribute(xv_driver_t *this, char *name) { +static void xv_store_port_attribute(xv_driver_t *this, const char * const name) { xcb_intern_atom_cookie_t atom_cookie; xcb_intern_atom_reply_t *atom_reply; -- cgit v1.2.3 From 38220c5485ca1f3dea10683fe9e9898d744bd162 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 00:18:56 +0200 Subject: Fixed pointer type --HG-- branch : point-release --- src/dxr3/video_out_dxr3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index 12cc3b76f..7e24781bf 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.h @@ -131,7 +131,7 @@ typedef struct dxr3_frame_s { vo_frame_t vo_frame; uint32_t oheight; int aspect, pan_scan; - uint8_t *mem; /* allocated for YV12 or YUY2 buffers */ + void *mem; /* allocated for YV12 or YUY2 buffers */ uint8_t *real_base[3]; /* yuv/yuy2 buffers in mem aligned on 16 */ int swap_fields; /* shifts Y buffer one line to exchange odd/even lines */ } dxr3_frame_t; -- cgit v1.2.3 From ed12923c2a40fa721429ff0271ad159adf74662d Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 00:40:21 +0200 Subject: define _XOPEN_SOURCE before including any system headers --HG-- branch : point-release --- src/libdts/xine_dts_decoder.c | 8 ++++---- src/libxineadec/xine_lpcm_decoder.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/libdts/xine_dts_decoder.c b/src/libdts/xine_dts_decoder.c index dbf8de718..a3c2eebf0 100644 --- a/src/libdts/xine_dts_decoder.c +++ b/src/libdts/xine_dts_decoder.c @@ -21,10 +21,6 @@ * 09-12-2001 DTS passthrough inprovements (C) James Courtier-Dutton */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef __sun /* required for swab() */ #define _XOPEN_SOURCE 500 @@ -32,6 +28,10 @@ /* avoid compiler warnings */ #define _BSD_SOURCE 1 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c index 71ac3f802..100fcee9a 100644 --- a/src/libxineadec/xine_lpcm_decoder.c +++ b/src/libxineadec/xine_lpcm_decoder.c @@ -21,16 +21,16 @@ * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifndef __sun #define _XOPEN_SOURCE 500 #endif /* avoid compiler warnings */ #define _BSD_SOURCE 1 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include -- cgit v1.2.3 From 728a4c3a60468715bfa73423d248d2397584615c Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 00:45:03 +0200 Subject: Fixed using uninitialized data --HG-- branch : point-release --- src/libsputext/xine_sputext_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index cda8a5983..3090c640e 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -551,7 +551,7 @@ static int is_cjk_encoding(const char *enc) { static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) { int y; - int sub_x, sub_y, max_width; + int sub_x, sub_y, max_width = this->width; int alignment; _x_assert(this->renderer != NULL); -- cgit v1.2.3 From e6491929982ee688487bee2b8ace43e3ae9ffb3f Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 09:56:23 +0200 Subject: Fixed osd_hide() return value --HG-- branch : point-release --- src/xine-engine/osd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 32e5e36fd..1d22ea303 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -374,7 +374,7 @@ static int osd_hide (osd_object_t *osd, int64_t vpts) { this->stream->xine->port_ticket->release(this->stream->xine->port_ticket, 1); - return 1; + return ret; } -- cgit v1.2.3 From 6b454a7621efa197b3f922c1ea840b359ac573b2 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 11:15:58 +0200 Subject: Removed write-only variables --HG-- branch : point-release --- src/video_out/video_out_syncfb.c | 3 --- src/xine-engine/load_plugins.c | 5 ----- 2 files changed, 8 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 4cb11dc93..68a04c33d 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -874,14 +874,11 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi syncfb_class_t *class = (syncfb_class_t *) class_gen; config_values_t *config = class->config; syncfb_driver_t* this; - Display* display = NULL; unsigned int i; x11_visual_t* visual = (x11_visual_t *) visual_gen; XColor dummy; XWindowAttributes attr; - display = visual->display; - if(!(this = calloc(1, sizeof (syncfb_driver_t)))) return NULL; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 0080bc30c..06ff719e0 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1662,7 +1662,6 @@ xine_video_port_t *xine_new_framegrab_video_port (xine_t *this) { plugin_node_t *node; vo_driver_t *driver; xine_video_port_t *port; - vo_info_t *vo_info; plugin_catalog_t *catalog = this->plugin_catalog; char *id; int list_id, list_size; @@ -1677,7 +1676,6 @@ xine_video_port_t *xine_new_framegrab_video_port (xine_t *this) { node = xine_sarray_get (catalog->plugin_lists[PLUGIN_VIDEO_OUT - 1], list_id); - vo_info = (vo_info_t *)node->info->special_info; if (!strcasecmp (node->info->id, id)) { driver = _load_video_driver (this, node, NULL); break; @@ -1772,7 +1770,6 @@ ao_driver_t *_x_load_audio_output_plugin (xine_t *this, const char *id) { plugin_node_t *node; ao_driver_t *driver = NULL; - ao_info_t *ao_info; plugin_catalog_t *catalog = this->plugin_catalog; int list_id, list_size; @@ -1783,8 +1780,6 @@ ao_driver_t *_x_load_audio_output_plugin (xine_t *this, const char *id) node = xine_sarray_get (this->plugin_catalog->plugin_lists[PLUGIN_AUDIO_OUT - 1], list_id); - ao_info = (ao_info_t *)node->info->special_info; - if (!strcasecmp(node->info->id, id)) { driver = _load_audio_driver (this, node, NULL); break; -- cgit v1.2.3 From 3bb1c31545d8ee7fd55f3dc7269bb74df8648b1c Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 11:52:15 +0200 Subject: Silenced warning --HG-- branch : point-release --- src/xine-utils/cpu_accel.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 1e12986fb..3f0140c7a 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -46,11 +46,13 @@ #if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifndef __x86_64__ static jmp_buf sigill_return; static void sigill_handler (int n) { longjmp(sigill_return, 1); } +#endif static uint32_t arch_accel (void) { -- cgit v1.2.3 From 9ac49d0a98459e3d2710928e165a3cfca63c2d4b Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 11:58:59 +0200 Subject: Hide aliasing problems in xcb plugins --HG-- branch : point-release --- src/video_out/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index 84712db66..4923bea57 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -114,11 +114,11 @@ xineplug_LTLIBRARIES = $(xshm_module) $(xv_module) $(xvmc_module) \ xineplug_vo_out_xcbshm_la_SOURCES = video_out_xcbshm.c $(XCBOSD) xineplug_vo_out_xcbshm_la_LIBADD = $(YUV_LIBS) $(PTHREAD_LIBS) $(XCB_LIBS) $(XCBSHM_LIBS) $(LTLIBINTL) -xineplug_vo_out_xcbshm_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS) +xineplug_vo_out_xcbshm_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS) -fno-strict-aliasing xineplug_vo_out_xcbxv_la_SOURCES = deinterlace.c video_out_xcbxv.c $(XCBOSD) xineplug_vo_out_xcbxv_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) $(XCBXV_LIBS) $(XCB_LIBS) -xineplug_vo_out_xcbxv_la_CFLAGS = $(VISIBILITY_FLAG) $(XCB_CFLAGS) $(XCBXV_CFLAGS) +xineplug_vo_out_xcbxv_la_CFLAGS = $(VISIBILITY_FLAG) $(XCB_CFLAGS) $(XCBXV_CFLAGS) -fno-strict-aliasing xineplug_vo_out_xshm_la_SOURCES = video_out_xshm.c $(X11OSD) xineplug_vo_out_xshm_la_LIBADD = $(YUV_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) -- cgit v1.2.3 From ebdd937405e27e2fa5e7eff39654b30bab57e070 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 12:21:59 +0200 Subject: Fixed flac_read_callback() signature for flac 1.1.3+ (when sizeof(size_t) != sizeof(unsigned)) --HG-- branch : point-release --- src/combined/decoder_flac.c | 8 ++++++++ src/combined/demux_flac.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/combined/decoder_flac.c b/src/combined/decoder_flac.c index fe1822797..079c01008 100644 --- a/src/combined/decoder_flac.c +++ b/src/combined/decoder_flac.c @@ -82,11 +82,19 @@ typedef struct flac_decoder_s { * FLAC callback functions */ +#ifdef LEGACY_FLAC static FLAC__StreamDecoderReadStatus flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data) +#else +static FLAC__StreamDecoderReadStatus +flac_read_callback (const FLAC__StreamDecoder *decoder, + FLAC__byte buffer[], + size_t *bytes, + void *client_data) +#endif { flac_decoder_t *this = (flac_decoder_t *)client_data; int number_of_bytes_to_copy; diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c index 9c5f7de32..494bb5050 100644 --- a/src/combined/demux_flac.c +++ b/src/combined/demux_flac.c @@ -103,13 +103,17 @@ typedef struct demux_flac_class_s { static #ifdef LEGACY_FLAC FLAC__SeekableStreamDecoderReadStatus +flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, + FLAC__byte buffer[], + unsigned *bytes, + void *client_data) #else FLAC__StreamDecoderReadStatus -#endif flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], - unsigned *bytes, + size_t *bytes, void *client_data) +#endif { demux_flac_t *this = (demux_flac_t *)client_data; input_plugin_t *input = this->input; -- cgit v1.2.3 From 8304f7562d4023c2a5c8d7ca767c5676273dcbec Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 16 Dec 2011 12:25:20 +0200 Subject: flac decoder: int -> size_t --HG-- branch : point-release --- src/combined/decoder_flac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/combined/decoder_flac.c b/src/combined/decoder_flac.c index 079c01008..b8650810b 100644 --- a/src/combined/decoder_flac.c +++ b/src/combined/decoder_flac.c @@ -72,9 +72,9 @@ typedef struct flac_decoder_s { int channels; unsigned char *buf; - int buf_size; - int buf_pos; - int min_size; + size_t buf_size; + size_t buf_pos; + size_t min_size; } flac_decoder_t; @@ -97,16 +97,16 @@ flac_read_callback (const FLAC__StreamDecoder *decoder, #endif { flac_decoder_t *this = (flac_decoder_t *)client_data; - int number_of_bytes_to_copy; + size_t number_of_bytes_to_copy; - lprintf("flac_read_callback: %d\n", *bytes); + lprintf("flac_read_callback: %zd\n", (size_t)*bytes); if (this->buf_pos > *bytes) number_of_bytes_to_copy = *bytes; else number_of_bytes_to_copy = this->buf_pos; - lprintf("number_of_bytes_to_copy: %d\n", number_of_bytes_to_copy); + lprintf("number_of_bytes_to_copy: %zd\n", number_of_bytes_to_copy); *bytes = number_of_bytes_to_copy; -- cgit v1.2.3