From 388558bbbedf8499e696b90ed0eb91d76ed17723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 20 Dec 2008 02:05:30 +0100 Subject: Fix size of mrls array. --- src/input/input_dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 0fa5ba971..d4f4c342f 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -286,7 +286,7 @@ typedef struct { xine_t *xine; - char *mrls[5]; + char *mrls[6]; int numchannels; -- cgit v1.2.3 From 772ac85a2f75c15a7a214f5f7e60008bfc9a2e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 20 Dec 2008 02:05:43 +0100 Subject: Remove unused variable. --- src/video_out/video_out_xcbxv.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 807bb766d..be218658c 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1314,8 +1314,6 @@ static xcb_xv_port_t xv_autodetect_port(xv_driver_t *this, xcb_xv_port_t base, xv_prefertype prefer_type) { - xcb_xv_adaptor_info_iterator_t *start = adaptor_it; - for (; adaptor_it->rem; xcb_xv_adaptor_info_next(adaptor_it)) if (adaptor_it->data->type & XCB_XV_TYPE_IMAGE_MASK && (prefer_type == xv_prefer_none || -- cgit v1.2.3 From 09b2085570e9e192d94f46348d859c7a7720c606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 20 Dec 2008 02:05:56 +0100 Subject: Remove format warning. --- src/video_out/video_out_xv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index b71518958..a3612e3eb 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1435,7 +1435,7 @@ 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 %d - autodetecting\n"), + _("%s: could not open Xv port %"PRId32" - autodetecting\n"), LOG_MODULE, xv_port); xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port, prefer_type); } else -- cgit v1.2.3 From 26f54381780b0eb18c9779d1b08ee8540e5a411a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 20 Dec 2008 02:13:26 +0100 Subject: Comment out the unused variables, make sure side effects are preserved though. --- src/libspudvb/xine_spudvb_decoder.c | 61 +++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c index e6e885e1f..a5b34bc96 100644 --- a/src/libspudvb/xine_spudvb_decoder.c +++ b/src/libspudvb/xine_spudvb_decoder.c @@ -142,7 +142,6 @@ static void update_region (dvb_spu_decoder_t * this, int region_id, int region_w dvbsub_func_t *dvbsub = this->dvbsub; region_t *reg = &dvbsub->regions[region_id]; - page_t *page = &dvbsub->page; /* reject invalid sizes and set some limits ! */ if ( region_width<=0 || region_height<=0 || region_width>720 || region_height>576 ) { @@ -327,22 +326,27 @@ static void set_clut(dvb_spu_decoder_t *this,int CLUT_id,int CLUT_entry_id,int Y static void process_CLUT_definition_segment(dvb_spu_decoder_t *this) { dvbsub_func_t *dvbsub = this->dvbsub; - const uint16_t page_id= _X_BE_16(&dvbsub->buf[dvbsub->i]); + /* + const uint16_t page_id= _X_BE_16(&dvbsub->buf[dvbsub->i]); + */ dvbsub->i+=2; const uint16_t segment_length= _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i+=2; const int j=dvbsub->i+segment_length; const uint8_t CLUT_id=dvbsub->buf[dvbsub->i++]; - const uint8_t CLUT_version_number=(dvbsub->buf[dvbsub->i]&0xf0)>>4; + /* + const uint8_t CLUT_version_number=(dvbsub->buf[dvbsub->i]&0xf0)>>4; + */ dvbsub->i++; while (dvbsub->i < j) { const uint8_t CLUT_entry_id=dvbsub->buf[dvbsub->i++]; - - const uint8_t CLUT_flag_2_bit=(dvbsub->buf[dvbsub->i]&0x80)>>7; - const uint8_t CLUT_flag_4_bit=(dvbsub->buf[dvbsub->i]&0x40)>>6; - const uint8_t CLUT_flag_8_bit=(dvbsub->buf[dvbsub->i]&0x20)>>5; + /* + const uint8_t CLUT_flag_2_bit=(dvbsub->buf[dvbsub->i]&0x80)>>7; + const uint8_t CLUT_flag_4_bit=(dvbsub->buf[dvbsub->i]&0x40)>>6; + const uint8_t CLUT_flag_8_bit=(dvbsub->buf[dvbsub->i]&0x20)>>5; + */ const uint8_t full_range_flag=dvbsub->buf[dvbsub->i]&1; dvbsub->i++; @@ -455,13 +459,20 @@ static void process_region_composition_segment (dvb_spu_decoder_t * this) dvbsub->i += 2; const uint16_t region_height = _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i += 2; - const uint8_t region_level_of_compatibility = (dvbsub->buf[dvbsub->i] & 0xe0) >> 5; - const uint8_t region_depth = (dvbsub->buf[dvbsub->i] & 0x1c) >> 2; + /* + const uint8_t region_level_of_compatibility = (dvbsub->buf[dvbsub->i] & 0xe0) >> 5; + const uint8_t region_depth = (dvbsub->buf[dvbsub->i] & 0x1c) >> 2; + */ dvbsub->i++; const uint8_t CLUT_id = dvbsub->buf[dvbsub->i++]; - const uint8_t region_8_bit_pixel_code = dvbsub->buf[dvbsub->i++]; + /* + const uint8_t region_8_bit_pixel_code = dvbsub->buf[dvbsub->i]; + */ + dvbsub->i++; const uint8_t region_4_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4; - const uint8_t region_2_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2; + /* + const uint8_t region_2_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2; + */ dvbsub->i++; if(region_id>=MAX_REGIONS) @@ -491,7 +502,9 @@ static void process_region_composition_segment (dvb_spu_decoder_t * this) const uint16_t object_id = _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i += 2; const uint8_t object_type = (dvbsub->buf[dvbsub->i] & 0xc0) >> 6; - const uint8_t object_provider_flag = (dvbsub->buf[dvbsub->i] & 0x30) >> 4; + /* + const uint8_t object_provider_flag = (dvbsub->buf[dvbsub->i] & 0x30) >> 4; + */ const uint16_t object_x = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1]; dvbsub->i += 2; const uint16_t object_y = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1]; @@ -500,8 +513,11 @@ static void process_region_composition_segment (dvb_spu_decoder_t * this) dvbsub->regions[region_id].object_pos[object_id] = (object_x << 16) | object_y; if ((object_type == 0x01) || (object_type == 0x02)) { - const uint8_t foreground_pixel_code = dvbsub->buf[dvbsub->i++]; - const uint8_t background_pixel_code = dvbsub->buf[dvbsub->i++]; + /* + const uint8_t foreground_pixel_code = dvbsub->buf[dvbsub->i]; + const uint8_t background_pixel_code = dvbsub->buf[dvbsub->i+1]; + */ + dvbsub->i += 2; } } @@ -513,15 +529,19 @@ static void process_object_data_segment (dvb_spu_decoder_t * this) dvbsub->page.page_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1]; dvbsub->i += 2; - const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]); + /* + const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]); + */ dvbsub->i += 2; const uint16_t object_id = _X_BE_16(&dvbsub->buf[dvbsub->i]); dvbsub->i += 2; dvbsub->curr_obj = object_id; - const uint8_t object_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4; const uint8_t object_coding_method = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2; - const uint8_t non_modifying_colour_flag = (dvbsub->buf[dvbsub->i] & 0x02) >> 1; + /* + const uint8_t object_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4; + const uint8_t non_modifying_colour_flag = (dvbsub->buf[dvbsub->i] & 0x02) >> 1; + */ dvbsub->i++; if ( object_coding_method != 0 ) @@ -780,8 +800,11 @@ static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf) this->dvbsub->i = 0; - const uint8_t data_identifier = this->dvbsub->buf[this->dvbsub->i++]; - const uint8_t subtitle_stream_id = this->dvbsub->buf[this->dvbsub->i++]; + /* + const uint8_t data_identifier = this->dvbsub->buf[this->dvbsub->i]; + const uint8_t subtitle_stream_id = this->dvbsub->buf[this->dvbsub->i+1]; + */ + this->dvbsub += 2; while (this->dvbsub->i <= (PES_packet_length)) { /* SUBTITLING SEGMENT */ -- cgit v1.2.3 From f40e4009259a1f4ef827af483c1c6927f1b78121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 20 Dec 2008 02:16:41 +0100 Subject: Fix constantness. --- src/combined/demux_flac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c index ebba63701..fc638fe35 100644 --- a/src/combined/demux_flac.c +++ b/src/combined/demux_flac.c @@ -583,7 +583,7 @@ open_plugin (demux_class_t *class_gen, } break; case METHOD_BY_EXTENSION: { - char *ending, *mrl; + const char *ending, *mrl; mrl = input->get_mrl (input); @@ -715,22 +715,22 @@ open_plugin (demux_class_t *class_gen, /* FLAC Demuxer class */ -static char * +static const char * get_description (demux_class_t *this_gen) { return "FLAC demux plugin"; } -static char * +static const char * get_identifier (demux_class_t *this_gen) { return "FLAC"; } -static char * +static const char * get_extensions (demux_class_t *this_gen) { return "flac"; } -static char * +static const char * get_mimetypes (demux_class_t *this_gen) { return "audio/x-flac: flac: FLAC Audio;" "audio/flac: flac: FLAC Audio;"; -- cgit v1.2.3 From 676effa5043dcfa6537c06c28c2ad3b655e42535 Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Fri, 26 Dec 2008 17:54:21 +0000 Subject: Don't store immediately-discarded input read() results --- src/demuxers/demux_mpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 388be2140..fa167c70e 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -330,7 +330,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) if((this->dummy_space[0] & 0xf0) == 0x80) { /* read rest of header - AC3 */ - i = this->input->read (this->input, this->dummy_space+1, 3); + this->input->read (this->input, this->dummy_space+1, 3); /* contents */ for (i = len - 4; i > 0; i -= (this->audio_fifo) @@ -431,7 +431,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) header_len -= 5 ; } - i = this->input->read (this->input, this->dummy_space, header_len); + this->input->read (this->input, this->dummy_space, header_len); for (i = len; i > 0; i -= (this->audio_fifo) ? this->audio_fifo->buffer_pool_buf_size : this->video_fifo->buffer_pool_buf_size) { @@ -503,7 +503,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) } /* read rest of header */ - i = this->input->read (this->input, this->dummy_space, header_len); + this->input->read (this->input, this->dummy_space, header_len); /* contents */ -- cgit v1.2.3 From 59ed0e154af747ba4f69712e967bc19f0d0ec17e Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 27 Dec 2008 21:00:31 +0000 Subject: Clean up Xv attribute-setting functions; fix a related off-by-one (xcbxv). --HG-- extra : transplant_source : %A0%EE%CC%FA%D3%AF2%8B%96%1F%B1%8E%00%01%96%8E%9E%AC%93Y --- src/video_out/video_out_xcbxv.c | 54 +++++++++-------------------------------- src/video_out/video_out_xv.c | 45 +++++++++------------------------- src/video_out/video_out_xxmc.c | 31 +++++++++-------------- 3 files changed, 35 insertions(+), 95 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index be218658c..bb7e32946 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1212,67 +1212,37 @@ static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) { this->deinterlace_method = entry->num_value; } -static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { +static void xv_update_attr (void *this_gen, xine_cfg_entry_t *entry, + const char *atomstr, const char *debugstr) +{ xv_driver_t *this = (xv_driver_t *) this_gen; - int xv_filter; xcb_intern_atom_cookie_t atom_cookie; xcb_intern_atom_reply_t *atom_reply; - xv_filter = entry->num_value; - pthread_mutex_lock(&this->main_mutex); - atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_FILTER"), "XV_FILTER"); + atom_cookie = xcb_intern_atom(this->connection, 0, strlen (atomstr), atomstr); atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL); - xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_filter); + xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, entry->num_value); free(atom_reply); pthread_mutex_unlock(&this->main_mutex); xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xcbxv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter); + LOG_MODULE ": %s = %d\n", debugstr, entry->num_value); } -static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - int xv_double_buffer; - - xcb_intern_atom_cookie_t atom_cookie; - xcb_intern_atom_reply_t *atom_reply; - - xv_double_buffer = entry->num_value; - - pthread_mutex_lock(&this->main_mutex); - atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_DOUBLE_BUFFER"), "XV_DOUBLE_BUFFER"); - atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL); - xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_double_buffer); - free(atom_reply); - pthread_mutex_unlock(&this->main_mutex); +static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { + xv_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode"); +} - xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xcbxv: double buffering mode = %d\n", xv_double_buffer); +static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { + xv_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode"); } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - int xv_sync_to_vblank; - - xcb_intern_atom_cookie_t atom_cookie; - xcb_intern_atom_reply_t *atom_reply; - - xv_sync_to_vblank = entry->num_value; - - pthread_mutex_lock(&this->main_mutex); - atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_SYNC_TO_VBLANK"), "XV_SYNC_TO_VBLANK"); - atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL); - xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_sync_to_vblank); - free(atom_reply); - pthread_mutex_unlock(&this->main_mutex); - - xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xcbxv: sync to vblank = %d\n", xv_sync_to_vblank); + xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); } - static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { xv_driver_t *this = (xv_driver_t *) this_gen; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index a3612e3eb..cc2990a03 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1269,52 +1269,31 @@ static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) { this->deinterlace_method = entry->num_value; } -static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { +static void xv_update_attr (void *this_gen, xine_cfg_entry_t *entry, + const char *atomstr, const char *debugstr) +{ xv_driver_t *this = (xv_driver_t *) this_gen; Atom atom; - int xv_filter; - - xv_filter = entry->num_value; LOCK_DISPLAY(this); - atom = XInternAtom (this->display, "XV_FILTER", False); - XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter); + atom = XInternAtom (this->display, atomstr, False); + XvSetPortAttribute (this->display, this->xv_port, atom, entry->num_value); UNLOCK_DISPLAY(this); xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter); + LOG_MODULE ": %s = %d\n", debugstr, entry->num_value); } -static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - Atom atom; - int xv_double_buffer; - - xv_double_buffer = entry->num_value; - - LOCK_DISPLAY(this); - atom = XInternAtom (this->display, "XV_DOUBLE_BUFFER", False); - XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer); - UNLOCK_DISPLAY(this); +static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { + xv_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode"); +} - xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xv: double buffering mode = %d\n", xv_double_buffer); +static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { + xv_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode"); } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - Atom atom; - int xv_sync_to_vblank; - - xv_sync_to_vblank = entry->num_value; - - LOCK_DISPLAY(this); - atom = XInternAtom (this->display, "XV_SYNC_TO_VBLANK", False); - XvSetPortAttribute (this->display, this->xv_port, atom, xv_sync_to_vblank); - UNLOCK_DISPLAY(this); - - xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xv: sync to vblank = %d\n", xv_sync_to_vblank); + xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); } static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index b3ac39697..06a42b23f 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -2129,36 +2129,27 @@ static void xxmc_check_capability (xxmc_driver_t *this, this->props[property].value = int_default; } -static void xxmc_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { +static void xxmc_update_attr (void *this_gen, xine_cfg_entry_t *entry, + const char *atomstr, const char *debugstr) +{ xxmc_driver_t *this = (xxmc_driver_t *) this_gen; Atom atom; - int xv_filter; - - xv_filter = entry->num_value; XLockDisplay(this->display); - atom = XInternAtom (this->display, "XV_FILTER", False); - XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter); + atom = XInternAtom (this->display, atomstr, False); + XvSetPortAttribute (this->display, this->xv_port, atom, entry->num_value); XUnlockDisplay(this->display); xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xxmc: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter); + LOG_MODULE ": %s = %d\n", debugstr, entry->num_value); } -static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { - xxmc_driver_t *this = (xxmc_driver_t *) this_gen; - Atom atom; - int xv_double_buffer; - - xv_double_buffer = entry->num_value; - - XLockDisplay(this->display); - atom = XInternAtom (this->display, "XV_DOUBLE_BUFFER", False); - XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer); - XUnlockDisplay(this->display); +static void xxmc_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { + xxmc_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode"); +} - xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_xxmc: double buffering mode = %d\n", xv_double_buffer); +static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { + xxmc_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode"); } static void xxmc_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { -- cgit v1.2.3 From 5b3081d031ef5089cf6c1ace4ba01e610cbd81d4 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 27 Dec 2008 21:11:17 +0000 Subject: Recognise XV_VSYNC == XV_SYNC_TO_BLANK for xf86-video-ati 6.9.1. --- src/video_out/video_out_xcbxv.c | 10 ++++++++-- src/video_out/video_out_xv.c | 10 ++++++++-- src/video_out/xv_common.h | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index bb7e32946..42b841d7c 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -138,6 +138,8 @@ struct xv_driver_s { int use_colorkey; uint32_t colorkey; + int sync_is_vsync; + /* hold initial port attributes values to restore on exit */ xine_list_t *port_attributes; @@ -157,6 +159,7 @@ typedef struct { } xv_class_t; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1240,7 +1243,9 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); + xv_update_attr (this_gen, entry, + sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync], + "sync to vblank"); } static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { @@ -1504,7 +1509,8 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xv_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); - } else if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_SYNC_TO_VBLANK")) { + } else if(!strcmp(name, sync_atoms[this->sync_is_vsync = 0]) || + !strcmp(name, sync_atoms[this->sync_is_vsync = 1])) { int xv_sync_to_vblank; xv_sync_to_vblank = config->register_bool (config, "video.device.xv_sync_to_vblank", 1, diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index cc2990a03..c6f368339 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -143,6 +143,8 @@ struct xv_driver_s { int use_colorkey; uint32_t colorkey; + int sync_is_vsync; + /* hold initial port attributes values to restore on exit */ xine_list_t *port_attributes; @@ -170,6 +172,7 @@ typedef struct { static int gX11Fail; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1293,7 +1296,9 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); + xv_update_attr (this_gen, entry, + sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync], + "sync to vblank"); } static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { @@ -1562,7 +1567,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xv_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); - } else if(!strcmp(attr[k].name, "XV_SYNC_TO_VBLANK")) { + } else if(((this->sync_is_vsync = 0), !strcmp(name, sync_atoms[0])) || + ((this->sync_is_vsync = 1), !strcmp(name, sync_atoms[1]))) { int xv_sync_to_vblank; xv_sync_to_vblank = config->register_bool (config, "video.device.xv_sync_to_vblank", 1, diff --git a/src/video_out/xv_common.h b/src/video_out/xv_common.h index 259afe616..df6a3f6dc 100644 --- a/src/video_out/xv_common.h +++ b/src/video_out/xv_common.h @@ -57,6 +57,9 @@ _("pitch alignment workaround"), \ _("Some buggy video drivers need a workaround to function properly.") +#define VIDEO_DEVICE_XV_VSYNC_ATOMS \ + { "XV_SYNC_TO_VBLANK", "XV_VSYNC" } + typedef enum { xv_prefer_none, xv_prefer_overlay, xv_prefer_textured } xv_prefertype; -- cgit v1.2.3 From 953615d01307263853aab6130bce1fc9d816ca34 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 27 Dec 2008 21:47:13 +0000 Subject: Recognise XV_BICUBIC for xf86-video-ati 6.9.1. --- src/video_out/video_out_xcbxv.c | 12 ++++++++++++ src/video_out/video_out_xv.c | 12 ++++++++++++ src/video_out/video_out_xxmc.c | 12 ++++++++++++ src/video_out/xv_common.h | 7 +++++++ 4 files changed, 43 insertions(+) (limited to 'src') diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 42b841d7c..cdaaea75d 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -159,6 +159,7 @@ typedef struct { } xv_class_t; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES; static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { @@ -1248,6 +1249,11 @@ static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) "sync to vblank"); } +static void xv_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry) +{ + xv_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode"); +} + static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1522,6 +1528,12 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis "sync to under the XVideo Settings tab"), 20, xv_update_XV_SYNC_TO_VBLANK, this); config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank); + } else if(!strcmp(name, "XV_BICUBIC")) { + int xv_bicubic = + config->register_enum (config, "video.device.xv_bicubic", 2, + bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP, + 20, xv_update_XV_BICUBIC, this); + config->update_num(config,"video.device.xv_bicubic",xv_bicubic); } } } diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index c6f368339..cc5ed3fb0 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -172,6 +172,7 @@ typedef struct { static int gX11Fail; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES; static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { @@ -1301,6 +1302,11 @@ static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) "sync to vblank"); } +static void xv_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry) +{ + xv_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode"); +} + static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1580,6 +1586,12 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * "sync to under the XVideo Settings tab"), 20, xv_update_XV_SYNC_TO_VBLANK, this); config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank); + } else if(!strcmp(name, "XV_BICUBIC")) { + int xv_bicubic = + config->register_enum (config, "video.device.xv_bicubic", 2, + bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP, + 20, xv_update_XV_BICUBIC, this); + config->update_num(config,"video.device.xv_bicubic",xv_bicubic); } } } diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 06a42b23f..454f2cb8b 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -46,6 +46,7 @@ static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo, XvImage *myimage); static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES; /* * Acceleration level priority. Static for now. It may well turn out that IDCT @@ -2152,6 +2153,11 @@ static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry xxmc_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode"); } +static void xxmc_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry) +{ + xxmc_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode"); +} + static void xxmc_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { xxmc_driver_t *this = (xxmc_driver_t *) this_gen; @@ -2593,6 +2599,12 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xxmc_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); + } else if(!strcmp(name, "XV_BICUBIC")) { + int xv_bicubic = + config->register_enum (config, "video.device.xv_bicubic", 2, + bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP, + 20, xxmc_update_XV_BICUBIC, this); + config->update_num(config,"video.device.xv_bicubic",xv_bicubic); } } } diff --git a/src/video_out/xv_common.h b/src/video_out/xv_common.h index df6a3f6dc..e24728cdd 100644 --- a/src/video_out/xv_common.h +++ b/src/video_out/xv_common.h @@ -70,3 +70,10 @@ typedef enum { _("Selects which video output method is preferred. " \ "Detection is done using the reported Xv adaptor names.\n" \ "(Only applies when auto-detecting which Xv port to use.)") + +#define VIDEO_DEVICE_XV_BICUBIC_TYPES \ + { "Off", "On", "Auto", NULL } +#define VIDEO_DEVICE_XV_BICUBIC_HELP \ + _("bicubic filtering"), \ + _("This option controls bicubic filtering of the video image. " \ + "It may be used instead of, or as well as, xine's deinterlacers.") -- cgit v1.2.3