From d53222b72961aade08fb12b4ac1ed00f9268c67d Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 24 Dec 2007 17:07:09 +0000 Subject: =?UTF-8?q?Spelling=20correction:=20successfuly=20=E2=86=92=20succ?= =?UTF-8?q?essfully.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/input/input_cdda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 5f830a1d3..fd4dd1fa9 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1660,7 +1660,7 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) { this->cddb.fd = _cdda_cddb_socket_open(this); if(this->cddb.fd >= 0) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - _("input_cdda: successfuly connected to cddb server '%s:%d'.\n"), + _("input_cdda: successfully connected to cddb server '%s:%d'.\n"), this->cddb.server, this->cddb.port); } else { -- cgit v1.2.3 From 9f911a4387602eba171b314e3cfe02ce0deabf60 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 24 Dec 2007 18:58:26 +0000 Subject: Consistently use "colour", "colour key", "colour space" in output. Some instances of "key colour" remain; ffmpeg is unmodified. This change has caused two strings with two translations to collide (the strings have become identical since some instances already used "colour"). I have therefore arbitrarily dropped the first of the differing translations, the one for the string at src/video_out/video_out_directfb.c:1365. --- src/demuxers/demux_asf.c | 2 +- src/demuxers/demux_avi.c | 2 +- src/demuxers/demux_matroska.c | 6 +++--- src/demuxers/demux_qt.c | 2 +- src/dxr3/dxr3_spu_encoder.c | 8 ++++---- src/dxr3/video_out_dxr3.c | 8 ++++---- src/input/input_v4l.c | 2 +- src/libw32dll/DirectShow/DS_VideoDecoder.c | 2 +- src/libw32dll/dmo/DMO_VideoDecoder.c | 2 +- src/post/deinterlace/xine_plugin.c | 2 +- src/post/goom/ifs.c | 2 +- src/post/goom/xine_goom.c | 4 ++-- src/video_out/video_out_directfb.c | 12 ++++++------ src/video_out/video_out_fb.c | 2 +- src/video_out/video_out_xcbxv.c | 4 ++-- src/video_out/video_out_xv.c | 4 ++-- src/video_out/video_out_xvmc.c | 4 ++-- src/video_out/video_out_xxmc.c | 8 ++++---- src/video_out/vidix/drivers/mga_vid.c | 4 ++-- src/video_out/vidix/drivers/nvidia_vid.c | 4 ++-- src/video_out/vidix/drivers/savage_vid.c | 6 +++--- src/video_out/yuv2rgb.c | 8 ++++---- src/xine-engine/alphablend.c | 2 +- 23 files changed, 50 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 9c977f417..9aab59977 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -514,7 +514,7 @@ static int asf_read_header (demux_asf_t *this) { lprintf ("palette_count: %d\n", demux_stream->palette_count); if (demux_stream->palette_count > 256) { - lprintf ("number of colors exceeded 256 (%d)", demux_stream->palette_count); + lprintf ("number of colours exceeded 256 (%d)", demux_stream->palette_count); demux_stream->palette_count = 256; } if ((asf_stream->private_data_length - sizeof(xine_bmiheader) - 11) >= (demux_stream->palette_count * 4)) { diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 544c19d76..6bb0b289c 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -949,7 +949,7 @@ static avi_t *AVI_init(demux_avi_t *this) { lprintf ("palette_count: %d\n", AVI->palette_count); if (AVI->palette_count > 256) { - lprintf ("number of colors exceeded 256 (%d)", AVI->palette_count); + lprintf ("number of colours exceeded 256 (%d)", AVI->palette_count); AVI->palette_count = 256; } if ((strf_size - sizeof(xine_bmiheader)) >= (AVI->palette_count * 4)) { diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 4f3476049..b973c1caf 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -779,7 +779,7 @@ static int vobsub_parse_custom_colors(matroska_track_t *t, const char *start) { use_custom_colors = 1; else if (!strncasecmp(start, "OFF", 3) || (*start == '0')) use_custom_colors = 0; - lprintf("VobSub custom colors: %s\n", use_custom_colors ? "ON" : "OFF"); + lprintf("VobSub custom colours: %s\n", use_custom_colors ? "ON" : "OFF"); if ((start = strstr(start, "colors:")) != NULL) { start += 7; while (isspace(*start)) @@ -793,7 +793,7 @@ static int vobsub_parse_custom_colors(matroska_track_t *t, const char *start) { } if (i == 4) { t->sub_track->custom_colors = 4; - lprintf("VobSub colors: %06x,%06x,%06x,%06x\n", t->sub_track->colors[0], + lprintf("VobSub colours: %06x,%06x,%06x,%06x\n", t->sub_track->colors[0], t->sub_track->colors[1], t->sub_track->colors[2], t->sub_track->colors[3]); } @@ -853,7 +853,7 @@ static void init_codec_vobsub(demux_matroska_t *this, things_found |= vobsub_parse_size(track, start); else if (!strncasecmp(start, "palette:", 8)) things_found |= vobsub_parse_palette(track, start); - else if (!strncasecmp(start, "custom colors:", 14)) + else if (!strncasecmp(start, "custom colours:", 14)) things_found |= vobsub_parse_custom_colors(track, start); else if (!strncasecmp(start, "forced subs:", 12)) things_found |= vobsub_parse_forced_subs(track, start); diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index b9fadc804..a55a0aef3 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -1075,7 +1075,7 @@ static qt_error parse_trak_atom (qt_trak *trak, trak_atom[atom_pos + 0x1], trak_atom[atom_pos + 0x2], trak_atom[atom_pos + 0x3]); - debug_atom_load(" %d RGB colors\n", + debug_atom_load(" %d RGB colours\n", trak->stsd_atoms[k].video.palette_count); for (j = 0; j < trak->stsd_atoms[k].video.palette_count; j++) diff --git a/src/dxr3/dxr3_spu_encoder.c b/src/dxr3/dxr3_spu_encoder.c index 1dcc13b77..2517063ac 100644 --- a/src/dxr3/dxr3_spu_encoder.c +++ b/src/dxr3/dxr3_spu_encoder.c @@ -167,11 +167,11 @@ static void create_histogram(spu_encoder_t *this) #ifdef LOG for (i = 0; i < OVL_PALETTE_SIZE; i++) if (this->map[i]) - lprintf("histogram: color #%d 0x%.8x appears %d times\n", + lprintf("histogram: colour #%d 0x%.8x appears %d times\n", i, this->overlay->color[i], this->map[i]); for (i = 0; i < OVL_PALETTE_SIZE; i++) if (this->clip_map[i]) - lprintf("histogram: clip color #%d 0x%.8x appears %d times\n", + lprintf("histogram: clip colour #%d 0x%.8x appears %d times\n", i, this->overlay->hili_color[i], this->clip_map[i]); #endif } @@ -209,7 +209,7 @@ static void generate_clut(spu_encoder_t *this) } #ifdef LOG for (spu_color = 0; spu_color < 4; spu_color++) - lprintf("spu color %d: 0x%.8x, trans: %d\n", spu_color, + lprintf("spu colour %d: 0x%.8x, trans: %d\n", spu_color, this->color[spu_color], this->trans[spu_color]); #endif @@ -243,7 +243,7 @@ static void generate_clut(spu_encoder_t *this) } #ifdef LOG for (spu_color = 0; spu_color < 4; spu_color++) - lprintf("spu clip color %d: 0x%.8x, trans: %d\n", spu_color, + lprintf("spu clip colour %d: 0x%.8x, trans: %d\n", spu_color, this->hili_color[spu_color], this->hili_trans[spu_color]); #endif } diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index 73eb133e1..c51354157 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -431,13 +431,13 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v this->tv_switchable = 1; this->widescreen_enabled = confnum - 2; confstr = config->register_string(config, "dxr3.output.keycolor", "0x80a040", - _("overlay colorkey value"), _("Hexadecimal RGB value of the key color.\n" + _("overlay colour key value"), _("Hexadecimal RGB value of the key colour.\n" "You can try different values, if you experience windows becoming transparent " "when using DXR3 overlay mode."), 20, NULL, NULL); sscanf(confstr, "%x", &this->overlay.colorkey); confstr = config->register_string(config, "dxr3.output.keycolor_interval", "50.0", - _("overlay colorkey tolerance"), _("A greater value widens the tolerance for " - "the overlay keycolor.\nYou can try lower values, if you experience windows " + _("overlay colour key tolerance"), _("A greater value widens the tolerance for " + "the overlay key colour.\nYou can try lower values, if you experience windows " "becoming transparent when using DXR3 overlay mode, but parts of the image borders may " "disappear when using a too low setting."), 20, NULL, NULL); sscanf(confstr, "%f", &this->overlay.color_interval); @@ -509,7 +509,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v if (dxr3_overlay_set_keycolor(&this->overlay) != 0) xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, - "video_out_dxr3: setting the overlay keycolor failed.\n"); + "video_out_dxr3: setting the overlay key colour failed.\n"); if (dxr3_overlay_set_attributes(&this->overlay) != 0) xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, "video_out_dxr3: setting an overlay attribute failed.\n"); diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 2316ef9ba..b43a2684a 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -882,7 +882,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this) if (ret < 0) { close (this->video_fd); this->video_fd = -1; - lprintf("Grab: no colorspace format found\n"); + lprintf("Grab: no colour space format found\n"); return 0; } else diff --git a/src/libw32dll/DirectShow/DS_VideoDecoder.c b/src/libw32dll/DirectShow/DS_VideoDecoder.c index 44c6d26d7..c0a08d5e3 100644 --- a/src/libw32dll/DirectShow/DS_VideoDecoder.c +++ b/src/libw32dll/DirectShow/DS_VideoDecoder.c @@ -570,7 +570,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp if (result != 0) { if (csp) - printf("Warning: unsupported color space\n"); + printf("Warning: unsupported colour space\n"); else printf("Warning: unsupported bit depth\n"); diff --git a/src/libw32dll/dmo/DMO_VideoDecoder.c b/src/libw32dll/dmo/DMO_VideoDecoder.c index 3ad85645a..7b25085f0 100644 --- a/src/libw32dll/dmo/DMO_VideoDecoder.c +++ b/src/libw32dll/dmo/DMO_VideoDecoder.c @@ -524,7 +524,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c if (result != 0) { if (csp) - printf("Warning: unsupported color space\n"); + printf("Warning: unsupported colour space\n"); else printf("Warning: unsupported bit depth\n"); diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c index 99bd597f6..477e6812b 100644 --- a/src/post/deinterlace/xine_plugin.c +++ b/src/post/deinterlace/xine_plugin.c @@ -234,7 +234,7 @@ static char * get_static_help (void) { "\n" " Chroma_filter: DVD/MPEG2 use an interlaced image format that has " "a very poor vertical chroma resolution. Upsampling the chroma for purposes " - "of deinterlacing may cause some artifacts to occur (eg. color stripes). Use " + "of deinterlacing may cause some artifacts to occur (eg. colour stripes). Use " "this option to blur the chroma vertically after deinterlacing to remove " "the artifacts. Warning: cpu intensive.\n" "\n" diff --git a/src/post/goom/ifs.c b/src/post/goom/ifs.c index af84b777b..4c7ec75d1 100644 --- a/src/post/goom/ifs.c +++ b/src/post/goom/ifs.c @@ -64,7 +64,7 @@ IFSPoint; #define ifs_opts xlockmore_opts #define DEFAULTS "*delay: 20000 \n" \ -"*ncolors: 100 \n" +"*ncolours: 100 \n" #define SMOOTH_COLORS diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 351c997ba..8cd06dbd6 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.c @@ -221,8 +221,8 @@ static void *goom_init_plugin(xine_t *xine, void *data) cfg->register_enum (cfg, "effects.goom.csc_method", 0, goom_csc_methods, - _("colorspace conversion method"), - _("You can choose the colorspace conversion method used by goom.\n" + _("colour space conversion method"), + _("You can choose the colour space conversion method used by goom.\n" "The available selections should be self-explaining."), 20, csc_method_changed_cb, this); diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 3e30f664d..3aa5bf66a 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -1008,7 +1008,7 @@ static int directfb_set_property (vo_driver_t *this_gen, if (value > 0xffffff) value = 0xffffff; xprintf (this->xine, XINE_VERBOSITY_DEBUG, - "video_out_directfb: setting colorkey to 0x%06x.\n", value); + "video_out_directfb: setting colour key to 0x%06x.\n", value); this->colorkey = value; this->layer->SetDstColorKey (this->layer, (value & 0xff0000) >> 16, (value & 0x00ff00) >> 8, @@ -1266,7 +1266,7 @@ static void update_config_cb (void *data, xine_cfg_entry_t *entry) { if (config.options != this->config.options) { if (this->layer->SetConfiguration (this->layer, &config) != DFB_OK) { xprintf (this->xine, XINE_VERBOSITY_LOG, - "video_out_directfb: failed to set colorkeying to %d!\n", + "video_out_directfb: failed to set colour keying to %d!\n", entry->num_value); return; } @@ -1354,15 +1354,15 @@ static void init_config (directfb_driver_t *this) { if (this->caps & DLCAPS_DST_COLORKEY) { this->colorkeying = config->register_bool (config, "video.device.directfb_colorkeying", this->colorkeying, - _("enable video color key"), - _("Enable using a color key to tell the graphics card " + _("enable video colour key"), + _("Enable using a colour key to tell the graphics card " "where to overlay the video image."), 20, update_config_cb, (void *)this); this->colorkey = config->register_range (config, "video.device.directfb_colorkey", this->colorkey, 0, 0xffffff, - _("video color key"), - _("The color key is used to tell the graphics card " + _("video colour key"), + _("The colour key is used to tell the graphics card " "where to overlay the video image. Try different values, " "if you experience windows becoming transparent."), 10, update_config_cb, (void *)this); diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index 78d23cd91..2f7fd2d57 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -755,7 +755,7 @@ static int get_fb_fix_screeninfo(int fd, struct fb_fix_screeninfo *fix, xine_t * fix->type != FB_TYPE_PACKED_PIXELS) { xprintf(xine, XINE_VERBOSITY_LOG, - _("video_out_fb: only packed truecolor/directcolor is supported (%d).\n" + _("video_out_fb: only packed truecolour/directcolour is supported (%d).\n" " Check 'fbset -i' or try 'fbset -depth 16'.\n"), fix->visual); return 0; } diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index cb582baab..5b44ea12d 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1337,7 +1337,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis else xprintf(class->xine, XINE_VERBOSITY_LOG, _("video_out_xcbxv: using Xv port %d from adaptor %s for hardware " - "colorspace conversion and scaling.\n"), xv_port, + "colour space conversion and scaling.\n"), xv_port, xcb_xv_adaptor_info_name(adaptor_it.data)); this->xv_port = xv_port; @@ -1444,7 +1444,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis adaptor_it.data->base_id, "video.device.xv_autopaint_colorkey", _("autopaint colour key"), - _("Make Xv autopaint its colorkey.")); + _("Make Xv autopaint its colour key.")); } else if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_FILTER")) { int xv_filter; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 07b1e1186..7ff7b64e5 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1380,7 +1380,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * else xprintf(class->xine, XINE_VERBOSITY_LOG, _("video_out_xv: using Xv port %ld from adaptor %s for hardware " - "colorspace conversion and scaling.\n"), xv_port, + "colour space conversion and scaling.\n"), xv_port, adaptor_info[adaptor_num].name); UNLOCK_DISPLAY(this); @@ -1497,7 +1497,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * adaptor_info[adaptor_num].base_id, "video.device.xv_autopaint_colorkey", _("autopaint colour key"), - _("Make Xv autopaint its colorkey.")); + _("Make Xv autopaint its colour key.")); } else if(!strcmp(attr[k].name, "XV_FILTER")) { int xv_filter; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 8f7b1defc..31d4c053d 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -1451,7 +1451,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi class->adaptor_info[class->adaptor_num].base_id, "XV_AUTOPAINT_COLORKEY", "video.device.xv_autopaint_colorkey", _("autopaint colour key"), - _("Make Xv autopaint its colorkey.")); + _("Make Xv autopaint its colour key.")); } else if(!strcmp(attr[k].name, "XV_DOUBLE_BUFFER")) { int xvmc_double_buffer; @@ -1742,7 +1742,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { else { xprintf (xine, XINE_VERBOSITY_LOG, _("video_out_xvmc: using Xv port %ld from adaptor %s\n" - " for hardware colorspace conversion and scaling\n"), + " for hardware colour space conversion and scaling\n"), xv_port, adaptor_info[adaptor_num].name); if(IDCTaccel&XINE_VO_IDCT_ACCEL) diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index db5b753f5..2b27c3982 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -2424,7 +2424,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi else xprintf(class->xine, XINE_VERBOSITY_LOG, _("video_out_xxmc: using Xv port %ld from adaptor %s for hardware " - "colorspace conversion and scaling.\n"), xv_port, + "colour space conversion and scaling.\n"), xv_port, adaptor_info[adaptor_num].name); XUnlockDisplay(this->display); @@ -2535,7 +2535,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi adaptor_info[adaptor_num].base_id, "XV_AUTOPAINT_COLORKEY", "video.device.xv_autopaint_colorkey", _("autopaint colour key"), - _("Make Xv autopaint its colorkey.")); + _("Make Xv autopaint its colour key.")); } else if(!strcmp(attr[k].name, "XV_FILTER")) { int xv_filter; @@ -2647,8 +2647,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi 10, xxmc_update_cpu_save, this); this->reverse_nvidia_palette = config->register_bool (config, "video.device.xvmc_nvidia_color_fix", 0, - _("Fix buggy NVIDIA XvMC subpicture colors"), - _("There's a bug in NVIDIA's XvMC lib that makes red OSD colors\n" + _("Fix buggy NVIDIA XvMC subpicture colours"), + _("There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n" "look blue and vice versa. This option provides a workaround.\n"), 10, xxmc_update_nvidia_fix, this); this->bob = diff --git a/src/video_out/vidix/drivers/mga_vid.c b/src/video_out/vidix/drivers/mga_vid.c index eed2b9e65..edebc0c4f 100644 --- a/src/video_out/vidix/drivers/mga_vid.c +++ b/src/video_out/vidix/drivers/mga_vid.c @@ -425,7 +425,7 @@ static void mga_vid_write_regs(int restore) writeb(PALWTADD, XCOLMSK); writeb(X_DATAREG, colkey_mask[3]); - printf(MGA_MSG" Restored colorkey (ON: %d %02X:%02X:%02X)\n", + printf(MGA_MSG" Restored colour key (ON: %d %02X:%02X:%02X)\n", colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]); } else if (!colkey_saved) { @@ -453,7 +453,7 @@ static void mga_vid_write_regs(int restore) writeb(PALWTADD, XCOLMSK); colkey_mask[3]=(unsigned char)readb(X_DATAREG); - printf(MGA_MSG" Saved colorkey (ON: %d %02X:%02X:%02X)\n", + printf(MGA_MSG" Saved colour key (ON: %d %02X:%02X:%02X)\n", colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]); } diff --git a/src/video_out/vidix/drivers/nvidia_vid.c b/src/video_out/vidix/drivers/nvidia_vid.c index 34fa27cb7..e820d58e8 100644 --- a/src/video_out/vidix/drivers/nvidia_vid.c +++ b/src/video_out/vidix/drivers/nvidia_vid.c @@ -955,12 +955,12 @@ int vixSetGrKeys( const vidix_grkey_t * grkey){ if (grkey->ckey.op == CKEY_FALSE) { info->use_colorkey = 0; - printf("[nvidia_vid] colorkeying disabled\n"); + printf("[nvidia_vid] colour keying disabled\n"); } else { info->use_colorkey = 1; info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); - printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey); + printf("[nvidia_vid] set colour key 0x%x\n",info->vidixcolourkey); } if(info->d_width && info->d_height)rivatv_overlay_start(info,0); return 0; diff --git a/src/video_out/vidix/drivers/savage_vid.c b/src/video_out/vidix/drivers/savage_vid.c index 2ac76198d..0ad7b0b15 100644 --- a/src/video_out/vidix/drivers/savage_vid.c +++ b/src/video_out/vidix/drivers/savage_vid.c @@ -370,7 +370,7 @@ static void SavageSetColorKeyOld(void) blue = info->vidixcolorkey & 0x000000FF; if( !info->vidixcolorkey ) { - printf("SavageSetColorKey disabling colorkey\n"); + printf("SavageSetColorKey disabling colour key\n"); OUTREG( COL_CHROMA_KEY_CONTROL_REG, 0 ); OUTREG( CHROMA_KEY_UPPER_BOUND_REG, 0 ); OUTREG( BLEND_CONTROL_REG, 0 ); @@ -1134,13 +1134,13 @@ vixSetGrKeys (const vidix_grkey_t * grkey) { info->use_colorkey = 0; info->vidixcolorkey=0; - printf("[savage_vid] colorkeying disabled\n"); + printf("[savage_vid] colour keying disabled\n"); } else { info->use_colorkey = 1; info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); - printf("[savage_vid] set colorkey 0x%x\n",info->vidixcolorkey); + printf("[savage_vid] set colour key 0x%x\n",info->vidixcolourkey); } //FIXME: freezes if streams arent enabled SavageSetColorKeyOld(); diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index 0ca6537a7..c98dd518f 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -3220,7 +3220,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped, #ifdef LOG if (this->yuv2rgb_fun != NULL) - printf ("yuv2rgb: using MMXEXT for colorspace transform\n"); + printf ("yuv2rgb: using MMXEXT for colour space transform\n"); #endif } @@ -3230,7 +3230,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped, #ifdef LOG if (this->yuv2rgb_fun != NULL) - printf ("yuv2rgb: using MMX for colorspace transform\n"); + printf ("yuv2rgb: using MMX for colour space transform\n"); #endif } #endif @@ -3241,12 +3241,12 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped, #ifdef LOG if (this->yuv2rgb_fun != NULL) - printf ("yuv2rgb: using medialib for colorspace transform\n"); + printf ("yuv2rgb: using medialib for colour space transform\n"); #endif } #endif if (this->yuv2rgb_fun == NULL) { - lprintf ("no accelerated colorspace conversion found\n"); + lprintf ("no accelerated colour space conversion found\n"); yuv2rgb_c_init (this); } diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index 8fcc4c469..a7ab33cf8 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1959,7 +1959,7 @@ static int xx44_paletteIndex(xx44_palette_t *p, int color, uint32_t clut) } if (p->max_used == p->size -1) { - printf("video_out: Warning! Out of xx44 palette colors!\n"); + printf("video_out: Warning! Out of xx44 palette colours!\n"); return 1; } p->cluts[p->max_used] = clut; -- cgit v1.2.3 From dc18a39496751afaf27e0320cf5a8195c0548e80 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 26 Dec 2007 15:43:30 +0000 Subject: Fix pls parsing (broken in cset e0819c1c624a). (transplanted from c139cfe735874922208d936c8e49bbfa532ed2ec) --HG-- extra : transplant_source : %C19%CF%E75%87I%22%20%8D%93l%8EI%BB%FAS.%D2%EC --- src/demuxers/demux_real.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 938e1ca24..85d7dc5a3 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -804,8 +804,17 @@ static int demux_real_parse_references( demux_real_t *this) { lprintf("received %d bytes [%s]\n", buf_used, buf); - for(i=0;istream, 0, buf, NULL, 0, 0); + } + else for (i = 0; i < buf_used; ++i) + { /* "--stop--" is used to have pnm alternative for old real clients * new real clients will stop processing the file and thus use * rtsp protocol. @@ -820,8 +829,8 @@ static int demux_real_parse_references( demux_real_t *this) { if( !strncmp(&buf[i],"-->",3) ) comment = 0; - if( (!strncmp(&buf[i],"pnm://",6) || !strncmp(&buf[i],"rtsp://",7) || - !strncmp(&buf[i],"http://",7)) && !comment ) { + if( (!strncmp(&buf[i],"pnm://",6) || !strncmp(&buf[i],"rtsp://",7)) && + !comment ) { for(j=i; buf[j] && buf[j] != '"' && !isspace(buf[j]); j++ ) ; buf[j]='\0'; @@ -1533,7 +1542,7 @@ static int real_check_stream_type(uint8_t *buf, int len) buf[len] = '\0'; if( strstr(buf,"pnm://") || strstr(buf,"rtsp://") || strstr(buf,"") || - strstr(buf,"http://") ) + !strncmp(buf,"http://",7) ) return 2; return 0; -- cgit v1.2.3 From abe0ca3270213506a3aaa634af660bb5740fd97c Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 26 Dec 2007 23:30:56 +0000 Subject: =?UTF-8?q?Correct=20a=20color=E2=86=92colour=20change=20to=20a=20?= =?UTF-8?q?struct=20member=20name.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/video_out/vidix/drivers/nvidia_vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/vidix/drivers/nvidia_vid.c b/src/video_out/vidix/drivers/nvidia_vid.c index e820d58e8..b051df326 100644 --- a/src/video_out/vidix/drivers/nvidia_vid.c +++ b/src/video_out/vidix/drivers/nvidia_vid.c @@ -960,7 +960,7 @@ int vixSetGrKeys( const vidix_grkey_t * grkey){ else { info->use_colorkey = 1; info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); - printf("[nvidia_vid] set colour key 0x%x\n",info->vidixcolourkey); + printf("[nvidia_vid] set colour key 0x%x\n",info->vidixcolorkey); } if(info->d_width && info->d_height)rivatv_overlay_start(info,0); return 0; -- cgit v1.2.3 From 1cadbbbb3a78933f28c113bb8cfab12b25d92ec8 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 26 Dec 2007 23:46:36 +0000 Subject: =?UTF-8?q?Correct=20another=20color=E2=86=92colour=20change=20to?= =?UTF-8?q?=20a=20struct=20member=20name.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/video_out/vidix/drivers/savage_vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/vidix/drivers/savage_vid.c b/src/video_out/vidix/drivers/savage_vid.c index 0ad7b0b15..17040cc15 100644 --- a/src/video_out/vidix/drivers/savage_vid.c +++ b/src/video_out/vidix/drivers/savage_vid.c @@ -1140,7 +1140,7 @@ vixSetGrKeys (const vidix_grkey_t * grkey) info->use_colorkey = 1; info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue); - printf("[savage_vid] set colour key 0x%x\n",info->vidixcolourkey); + printf("[savage_vid] set colour key 0x%x\n",info->vidixcolorkey); } //FIXME: freezes if streams arent enabled SavageSetColorKeyOld(); -- cgit v1.2.3 From 0fed3e1eccfdbae81961b3aadff0375c54c9f8d5 Mon Sep 17 00:00:00 2001 From: Michel Verbraak Date: Thu, 27 Dec 2007 14:20:37 +0000 Subject: net_plugin not always reading preview buffer to the maximum. --- src/input/input_net.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/input/input_net.c b/src/input/input_net.c index 4dfa63eda..fe78c93f4 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -411,6 +411,8 @@ static int net_plugin_open (input_plugin_t *this_gen ) { char *filename; char *pptr; int port = 7658; + int toread = MAX_PREVIEW_SIZE; + int trycount = 0; filename = this->host_port; pptr=strrchr(filename, ':'); @@ -429,11 +431,15 @@ static int net_plugin_open (input_plugin_t *this_gen ) { /* * fill preview buffer */ + while ((toread > 0) && (trycount < 10)) { #ifndef WIN32 - this->preview_size = read (this->fh, this->preview, MAX_PREVIEW_SIZE); + this->preview_size += read (this->fh, this->preview + this->preview_size, toread); #else - this->preview_size = recv (this->fh, this->preview, MAX_PREVIEW_SIZE, 0); + this->preview_size += recv (this->fh, this->preview + this->preview_size, toread, 0); #endif + trycount++; + toread = MAX_PREVIEW_SIZE - this->preview_size; + } this->curpos = 0; -- cgit v1.2.3 From 84e2f56c6cc81e9bed8ba03b29a8c69aa7d08d89 Mon Sep 17 00:00:00 2001 From: Dubois Nicolas Date: Thu, 27 Dec 2007 14:24:48 +0000 Subject: [Subtitles] SSA-tags patch I watch a lot of movies with subtitles and I need "vobsub subtitles" work in xine, then I decide to write this patch. It may support SSA tags for all text subtiles (ssa, ass, srt, ...) This patch : 1. Remove all SSA tags from stream (they are ugly : {\a6}) 2. Handle some of them (b, i, a, an, pos). The other ones control colours, shadow, animation, ... I can't make them work in an easy way. 3. Correct wrap algorithm which have minors bugs (we can see them only with SSA patch...) Modified files : libsputext/demux_sputext.c just remove unneeded code (which remove some of SSA-tags) libsputext/xine_sputext_decoder.c the main modified file. video_out/video_out_xshm.c video_out/video_out_xv.c xine-engine/video_out.h get video output (position and size). See below. 1. Removing SSA tags is done in ogm_render_line_internal() like for html-like tags. (this was done in the previous version of xine) 2. b(bold) and i(italic) are implemented like html-ones, in ogm_render_line_internal(). The other tags this patch support are : aX : alignment in SSA-code anX : alignment in numpad code pos(X,Y) : position, depend on alignment For those ones, I need in first a full-screen OSD, not a five lines one. Then, I need to remember where the last subtitle was drawn, in order to erase it. At last, I need a translation function to convert subtitle coordinates in screen coordinates. For this last point, I first write a full-screen translation (don't care about blacks borders), but it's not really good: the 'pos' tag is sometime used to point out something in the video. (Moreover, ASS spec say we have to draw subtitle on the video) For doing this, I need the real video output size and position, which are only know by the video output driver! Then I had 4 VO properties (in xine-engine/video_out.h) for video driver could give us those informations. I implement it only in xshm and xv drivers (I can't test other ones). If video driver can't give us those informations, the patch fallback in a full-screen translation. 3. there was 3 problem with the wrap algorithm : 1. It was in double: exactly the same, twice. Look like a merge problem. I remove one and all work fine. 2. It want to cut string in equivalent display length but it cut it in equivalent byte length. In most cases, this is the same, but if we have UTF-8 chars or long SSA-tags (which will not be displayed) the result is strange. 3. If we have a too-long part (in bytes) of the string without spaces (bad subtitle file or long SSA-code), the algorithm don't know what to do. (this case is not handled) I re-write the wrap algorithm to correct those problems. Note that my version is slower than previous one : working with bytes is really faster than computing text-length. Maybe I should had to propose an other patch for this part... --- src/libsputext/demux_sputext.c | 25 -- src/libsputext/xine_sputext_decoder.c | 551 ++++++++++++++++++++++------------ src/video_out/video_out_xshm.c | 8 + src/video_out/video_out_xv.c | 12 + src/xine-engine/video_out.h | 6 +- 5 files changed, 389 insertions(+), 213 deletions(-) (limited to 'src') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 502ef6580..acf8e10f6 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -382,31 +382,6 @@ static subtitle_t *sub_read_line_subrip(demux_sputext_t *this,subtitle_t *curren } else temp_line[temp_index++]=*p; break; - case '{': -#if 0 /* italic not implemented in renderer, ignore them for now */ - if(!strncmp(p,"{\\i1}",5) && temp_index+3>8)+16)<<8)|(((112*R-94*G-18*B+128)>>8)+128))<<8|(((-38*R-74*G+112*B+128)>>8)+128)) static uint32_t sub_palette[22]={ @@ -106,6 +126,15 @@ typedef struct sputext_class_s { } sputext_class_t; +/* Convert subtiles coordinates in window coordinates. */ +/* (a, b) --> (x + a * dx, y + b * dy) */ +typedef struct video2wnd_s { + int x; + int y; + double dx; + double dy; +} video2wnd_t; + typedef struct sputext_decoder_s { spu_decoder_t spu_decoder; @@ -141,7 +170,9 @@ typedef struct sputext_decoder_s { int64_t last_subtitle_end; /* no new subtitle before this vpts */ int unscaled; /* use unscaled OSD */ + int last_y; /* location of the previous subtitle */ int last_lines; /* number of lines of the previous subtitle */ + video2wnd_t video2wnd; } sputext_decoder_t; static inline char *get_font (sputext_class_t *class) @@ -156,8 +187,6 @@ static inline char *get_font (sputext_class_t *class) static void update_font_size (sputext_decoder_t *this, int force_update) { static int sizes[SUBTITLE_SIZE_NUM] = { 16, 20, 24, 32, 48, 64 }; - int y; - if ((this->subtitle_size != this->class->subtitle_size) || (this->vertical_offset != this->class->vertical_offset) || force_update) { @@ -170,21 +199,17 @@ static void update_font_size (sputext_decoder_t *this, int force_update) { this->line_height = this->font_size + 10; - y = this->height - (SUB_MAX_TEXT * this->line_height) - 5; - - if(((y - this->class->vertical_offset) >= 0) && ((y - this->class->vertical_offset) <= this->height)) - y -= this->class->vertical_offset; - + /* Create a full-window OSD */ if( this->osd ) this->renderer->free_object (this->osd); - lprintf("new osd object, width %d, height %d*%d\n", this->width, SUB_MAX_TEXT, this->line_height); this->osd = this->renderer->new_object (this->renderer, this->width, - SUB_MAX_TEXT * this->line_height); + this->height); this->renderer->set_font (this->osd, get_font (this->class), this->font_size); - this->renderer->set_position (this->osd, 0, y); + + this->renderer->set_position (this->osd, 0, 0); } } @@ -208,7 +233,7 @@ static void update_output_size (sputext_decoder_t *this) { VO_PROP_WINDOW_HEIGHT) || !this->img_duration || !this->osd ) { - int width = 0, height = 0; /* dummy */ + int width = 0, height = 0; this->stream->video_out->status(this->stream->video_out, NULL, &width, &height, &this->img_duration ); @@ -220,8 +245,36 @@ static void update_output_size (sputext_decoder_t *this) { VO_PROP_WINDOW_HEIGHT); if(!this->osd || (this->width && this->height)) { + + /* in unscaled mode, we have to convert subtitle position in window coordinates. */ + /* we have a scale factor because video may be zommed */ + /* and a displacement factor because video may have blacks lines. */ + int output_width, output_height, output_xoffset, output_yoffset; + + output_width = this->stream->video_out->get_property(this->stream->video_out, + VO_PROP_OUTPUT_WIDTH); + output_height = this->stream->video_out->get_property(this->stream->video_out, + VO_PROP_OUTPUT_HEIGHT); + output_xoffset = this->stream->video_out->get_property(this->stream->video_out, + VO_PROP_OUTPUT_XOFFSET); + output_yoffset = this->stream->video_out->get_property(this->stream->video_out, + VO_PROP_OUTPUT_YOFFSET); + + /* driver don't seen to be capable to give us those values */ + /* fallback to a default full-window values */ + if (output_width <= 0 || output_height <= 0) { + output_width = this->width; + output_height = this->height; + output_xoffset = 0; + output_yoffset = 0; + } + + this->video2wnd.x = output_xoffset; + this->video2wnd.y = output_yoffset; + this->video2wnd.dx = (double)output_width / SPU_PROJECTION_X; + this->video2wnd.dy = (double)output_height / SPU_PROJECTION_Y; + this->renderer = this->stream->osd_renderer; - update_font_size (this, 1); } } @@ -238,6 +291,12 @@ static void update_output_size (sputext_decoder_t *this) { if(!this->osd || ( this->width && this->height)) { this->renderer = this->stream->osd_renderer; + /* in scaled mode, we have to convert subtitle position in film coordinates. */ + this->video2wnd.x = 0; + this->video2wnd.y = 0; + this->video2wnd.dx = (double)this->width / SPU_PROJECTION_X; + this->video2wnd.dy = (double)this->height / SPU_PROJECTION_Y; + update_font_size (this, 1); } } @@ -270,7 +329,8 @@ static int parse_utf8_size(unsigned char *c) static int ogm_render_line_internal(sputext_decoder_t *this, int x, int y, const char *text, int render) { - int i = 0, w, dummy; + int i = 0, w, value; + char* end; char letter[5]={0, 0, 0, 0, 0}; const char *encoding = this->buf_encoding ? this->buf_encoding : this->class->src_encoding; @@ -278,55 +338,82 @@ static int ogm_render_line_internal(sputext_decoder_t *this, int x, int y, const size_t length = strlen (text); while (i <= length) { - switch (text[i]) { - case '<': + + if (text[i] == '<') { if (!strncmp("", text+i, 3)) { /* enable Bold color */ if (render) this->current_osd_text = OSD_TEXT2; i=i+3; - break; + continue; } else if (!strncmp("", text+i, 4)) { /* disable BOLD */ if (render) this->current_osd_text = OSD_TEXT1; i=i+4; - break; + continue; } else if (!strncmp("", text+i, 3)) { /* enable italics color */ if (render) this->current_osd_text = OSD_TEXT3; i=i+3; - break; + continue; } else if (!strncmp("", text+i, 4)) { /* disable italics */ if (render) this->current_osd_text = OSD_TEXT1; i=i+4; - break; + continue; } else if (!strncmp("", text+i, 6)) { /*Do somethink to disable typing fixme - no teststreams*/ i=i+6; - break; + continue; } else if (!strncmp("", text+i, 7)) { /*Do somethink to enable typing fixme - no teststreams*/ i=i+7; - break; - } - default: - shift = isutf8 ? parse_utf8_size (&text[i]) : 1; - memcpy(letter,&text[i],shift); - letter[shift]=0; - - if (render) - this->renderer->render_text(this->osd, x, y, letter, this->current_osd_text); - this->renderer->get_text_size(this->osd, letter, &w, &dummy); - x=x+w; - i+=shift; + continue; + } + } + if (text[i] == '{') { + + if (!strncmp("{\\", text+i, 2)) { + + if (sscanf(text+i, "{\\b%d}", &value) == 1) { + if (render) { + if (value) + this->current_osd_text = OSD_TEXT2; + else + this->current_osd_text = OSD_TEXT1; + } + } else if (sscanf(text+i, "{\\i%d}", &value) == 1) { + if (render) { + if (value) + this->current_osd_text = OSD_TEXT3; + else + this->current_osd_text = OSD_TEXT1; + } + } + end = strstr(text+i+2, "}"); + if (end) { + i=end-text+1; + continue; + } + } } + + shift = isutf8 ? parse_utf8_size (&text[i]) : 1; + memcpy(letter,&text[i],shift); + letter[shift]=0; + + if (render) + this->renderer->render_text(this->osd, x, y, letter, this->current_osd_text); + this->renderer->get_text_size(this->osd, letter, &w, &value); + x=x+w; + i+=shift; } + return x; } @@ -338,16 +425,103 @@ static inline void ogm_render_line(sputext_decoder_t *this, int x, int y, char* ogm_render_line_internal (this, x, y, text, 1); } +/* read SSA tags at begening of text. Suported tags are : */ +/* \a : alignment in SSA code (see #defines) */ +/* \an : alignment in 'numpad code' */ +/* \pos : absolute position of subtitles. Alignment define origin. */ +static void read_ssa_tag(sputext_decoder_t *this, const char* text, + int* alignment, int* sub_x, int* sub_y, int* max_width) { + + int in_tag = 0; + + (*alignment) = 2; + (*sub_x) = -1; + (*sub_y) = -1; + + while (*text) { + + /* wait for tag begin, allow space and tab */ + if (in_tag == 0) { + if (*text == '{') in_tag = 1; + else if ((*text != ' ') && (*text != '\t')) break; + + /* parse SSA command */ + } else { + if (*text == '\\') { + if (sscanf(text, "\\pos(%d,%d)", sub_x, sub_y) == 2) { + text += 8; /* just for speed up, 8 is the minimal with */ + } + + if (sscanf(text, "\\a%d", alignment) == 1) { + text += 2; + } + + if (sscanf(text, "\\an%d", alignment) == 1) { + text += 3; + if ((*alignment) > 6) (*alignment) = (*alignment) - 2; + else if ((*alignment) > 3) (*alignment) = (*alignment) + 5; + } + } + + if (*text == '}') in_tag = 0; + } + + text++; + } + + + /* check alignment validity */ + if ((*alignment) < 1 || (*alignment) > 11) { + (*alignment) = 2; + } + + /* convert to window coordinates */ + if ((*sub_x) >= 0 && (*sub_y) >= 0) { + (*sub_x) = this->video2wnd.x + this->video2wnd.dx * (*sub_x); + (*sub_y) = this->video2wnd.y + this->video2wnd.dy * (*sub_y); + } + + /* check validity, compute max width */ + if ( (*sub_x) < 0 || (*sub_x) >= this->width || + (*sub_y) < 0 || (*sub_y) >= this->height ) { + (*sub_x) = -1; + (*sub_y) = -1; + (*max_width) = this->width; + } else { + switch (GET_X_ALIGNMENT(*alignment)) { + case ALIGN_LEFT: + (*max_width) = this->width - (*sub_x); + break; + case ALIGN_CENTER: + (*max_width) = this->width; + break; + case ALIGN_RIGHT: + (*max_width) = (*sub_x); + break; + } + } + + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libsputext: position : (%d, %d), max width : %d, alignment : %d\n", + (*sub_x), (*sub_y), (*max_width), (*alignment)); +} + static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) { int line, y; int font_size; char *font; + int sub_x, sub_y, max_width; + int alignment; + int rebuild_all; + _x_assert(this->renderer != NULL); if ( ! this->renderer ) return; + read_ssa_tag(this, this->text[0], &alignment, &sub_x, &sub_y, &max_width); + update_font_size(this, 0); font = get_font (this->class); @@ -363,178 +537,181 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su else this->renderer->set_encoding(this->osd, this->class->src_encoding); - for (line = 0; line < this->lines; line++) /* first, check lenghts and word-wrap if needed */ - { - int w; - w = ogm_get_width( this, this->text[line]); - if( w > this->width ) { /* line is too long */ - int chunks=(int)(w/this->width)+(w%this->width?1:0); - if( this->lines+chunks <= SUB_MAX_TEXT && chunks>1 ) { /* try adding newlines while keeping existing ones */ - int a; - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,"Partial subtitle line splitting in %i chunks\n",chunks); - for(a=this->lines-1;a>=0;a--) { - if(a>line) /* lines after the too-long one */ - memcpy(this->text[a+chunks-1],this->text[a],SUB_BUFSIZE); - else if(a==line) { /* line to be splitted */ - int b,len=strlen(this->text[line]); - char *p=this->text[line]; - for(b=0;btext[line+b],p,SUB_BUFSIZE); - this->text[line+b][SUB_BUFSIZE - 1] = '\0'; - } else { - for(c=p+(int)(len/chunks)+(len%chunks?1:0);*c!=' ' && c>p && c!='\0';c--); - if(*c==' ') { - *c='\0'; - if(b) { /* we are reading something that has to be moved to another line */ - strncpy(this->text[line+b],p,SUB_BUFSIZE); - this->text[line+b][SUB_BUFSIZE - 1] = '\0'; - } - p=c+1; - } - } - } - } - } - this->lines+=chunks-1; - } else { /* regenerate all the lines to find something that better fits */ - char buf[SUB_BUFSIZE*SUB_MAX_TEXT]; - int a,w,chunks; - buf[0]='\0'; - for(a=0;alines;a++) { - if(a) { - int len=strlen(buf); - buf[len]=' '; - buf[len+1]='\0'; - } - strcat(buf,this->text[a]); + + rebuild_all = 0; + for (line = 0; line < this->lines; line++) { + int line_width = ogm_get_width(this, this->text[line]); + + /* line too long */ + if (line_width > max_width) { + char *current_cut, *best_cut; + int a; + + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libsputext: Line too long: %d > %d, split at max size.\n", + line_width, max_width); + + /* can't fit with keeping existing lines */ + if (this->lines + 1 > SUB_MAX_TEXT) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "libsputext: Can't fit with keeping existing line, we have to rebuild all the subtitle\n"); + rebuild_all = 1; + break; + } + + /* find the longest sequence witch fit */ + line_width = 0; + current_cut = this->text[line]; + best_cut = NULL; + while (line_width < max_width) { + while (*current_cut && *current_cut != ' ') current_cut++; + if (*current_cut == ' ') { + *current_cut = 0; + line_width = ogm_get_width(this, this->text[line]); + *current_cut = ' '; + if (line_width < max_width) best_cut = current_cut; + current_cut++; + } else { + break; /* end of line */ } - w = ogm_get_width( this, buf); - chunks=(int)(w/this->width)+(w%this->width?1:0); - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Complete subtitle line splitting in %i chunks\n",chunks); - if(chunks<=SUB_MAX_TEXT) {/* if the length is over than SUB_MAX_TEXT*this->width nothing can be done */ - int b,len=strlen(buf); - char *p=buf; - for(b=0;btext[b],p,SUB_BUFSIZE); - this->text[b][SUB_BUFSIZE - 1] = '\0'; - } else { - for(c=p+(int)(len/chunks)+(len%chunks?1:0);*c!=' ' && c>p && c!='\0';c--); - if(*c==' ') { - *c='\0'; - strncpy(this->text[b],p,SUB_BUFSIZE); - this->text[b][SUB_BUFSIZE - 1] = '\0'; - p=c+1; - } - } - } - this->lines=chunks; - } else - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Subtitle too long to be splited\n"); - line=this->lines; } + + if (best_cut == NULL) { + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "libsputext: Can't wrap line: a word is too long, abort.\n"); + break; + } + + /* move other lines */ + for (a = this->lines - 1; a > line; a--) + memcpy(this->text[a + 1], this->text[a], SUB_BUFSIZE); + + /* split current one */ + strncpy(this->text[line + 1], best_cut + 1, SUB_BUFSIZE); + *best_cut = 0; + + this->lines = this->lines + 1; } } - font_size = this->font_size; - if (this->buf_encoding) - this->renderer->set_encoding(this->osd, this->buf_encoding); - else - this->renderer->set_encoding(this->osd, this->class->src_encoding); + /* regenerate all the lines to find something that better fits */ + if (rebuild_all) { + int line, line_width; + char *stream, *current_cut, *best_cut; + char buf[SUB_BUFSIZE * SUB_MAX_TEXT]; + + buf[0] = 0; + for(line = 0; line < this->lines; line++) { + int len = strlen(buf); + if (len) { + buf[len] = ' '; + len++; + } + strncpy(buf + len, this->text[line], SUB_BUFSIZE); + *(buf + len + SUB_BUFSIZE) = 0; + } - for (line = 0; line < this->lines; line++) /* first, check lenghts and word-wrap if needed */ - { - int w; - w = ogm_get_width( this, this->text[line]); - if( w > this->width ) { /* line is too long */ - int chunks=(int)(w/this->width)+(w%this->width?1:0); - if( this->lines+chunks <= SUB_MAX_TEXT && chunks>1 ) { /* try adding newlines while keeping existing ones */ - int a; - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,"Partial subtitle line splitting in %i chunks\n",chunks); - for(a=this->lines-1;a>=0;a--) { - if(a>line) /* lines after the too-long one */ - memcpy(this->text[a+chunks-1],this->text[a],SUB_BUFSIZE); - else if(a==line) { /* line to be splitted */ - int b,len=strlen(this->text[line]); - char *p=this->text[line]; - for(b=0;btext[line+b],p,SUB_BUFSIZE); - this->text[line+b][SUB_BUFSIZE - 1] = '\0'; - } else { - for(c=p+(int)(len/chunks)+(len%chunks?1:0);*c!=' ' && c>p && c!='\0';c--); - if(*c==' ') { - *c='\0'; - if(b) { /* we are reading something that has to be moved to another line */ - strncpy(this->text[line+b],p,SUB_BUFSIZE); - this->text[line+b][SUB_BUFSIZE - 1] = '\0'; - } - p=c+1; - } - } - } - } - } - this->lines+=chunks-1; - } else { /* regenerate all the lines to find something that better fits */ - char buf[SUB_BUFSIZE*SUB_MAX_TEXT]; - int a,w,chunks; - buf[0]='\0'; - for(a=0;alines;a++) { - if(a) { - int len=strlen(buf); - buf[len]=' '; - buf[len+1]='\0'; + stream = buf; + this->lines = 0; + + do { + + if (this->lines + 1 < SUB_MAX_TEXT) { + + /* find the longest sequence witch fit */ + line_width = 0; + current_cut = stream; + best_cut = NULL; + while (line_width < max_width) { + while (*current_cut && *current_cut != ' ') current_cut++; + if (*current_cut == ' ') { + *current_cut = 0; + line_width = ogm_get_width(this, stream); + *current_cut = ' '; + if (line_width < max_width) best_cut = current_cut; + current_cut++; + } else { + line_width = ogm_get_width(this, stream); + if (line_width < max_width) best_cut = current_cut; + break; /* end of line */ } - strcat(buf,this->text[a]); } - w = ogm_get_width( this, buf); - chunks=(int)(w/this->width)+(w%this->width?1:0); - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Complete subtitle line splitting in %i chunks\n",chunks); - if(chunks<=SUB_MAX_TEXT) {/* if the length is over than SUB_MAX_TEXT*this->width nothing can be done */ - int b,len=strlen(buf); - char *p=buf; - for(b=0;btext[b],p,SUB_BUFSIZE); - this->text[b][SUB_BUFSIZE - 1] = '\0'; - } else { - for(c=p+(int)(len/chunks)+(len%chunks?1:0);*c!=' ' && c>p && c!='\0';c--); - if(*c==' ') { - *c='\0'; - strncpy(this->text[b],p,SUB_BUFSIZE); - this->text[b][SUB_BUFSIZE - 1] = '\0'; - p=c+1; - } - } - } - this->lines=chunks; - } else - xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Subtitle too long to be splited\n"); - line=this->lines; } - } + + /* line maybe too long, but we have reached last subtitle line */ + else { + best_cut = current_cut = stream + strlen(stream); + } + + /* copy current line */ + if (best_cut != NULL) *best_cut = 0; + strncpy(this->text[this->lines], stream, SUB_BUFSIZE); + this->lines = this->lines + 1; + + stream = best_cut + 1; + + } while (best_cut != current_cut); + } - if (this->last_lines) - this->renderer->filled_rect (this->osd, 0, this->line_height * (SUB_MAX_TEXT - this->last_lines), - this->width - 1, this->line_height * SUB_MAX_TEXT - 1, 0); - this->last_lines = this->lines; - y = (SUB_MAX_TEXT - this->lines) * this->line_height; + + /* Erase subtitle : use last_y and last_lines saved last turn. */ + if (this->last_lines) { + this->renderer->filled_rect (this->osd, 0, this->last_y, + this->width - 1, this->last_y + this->last_lines * this->line_height, + 0); + } + + switch (GET_Y_ALIGNMENT(alignment)) { + case ALIGN_TOP: + if (sub_y >= 0) y = sub_y; + else y = 5; + break; + + case ALIGN_MIDDLE: + if (sub_y >= 0) y = sub_y - (this->lines * this->line_height) / 2; + else y = (this->height - this->lines * this->line_height) / 2; + break; + + case ALIGN_BOTTOM: + default: + if (sub_y >= 0) y = sub_y - this->lines * this->line_height; + else y = this->height - this->lines * this->line_height - this->class->vertical_offset; + break; + } + if (y < 0 || y >= this->height) + y = this->height - this->line_height * this->lines; + + this->last_lines = this->lines; + this->last_y = y; + for (line = 0; line < this->lines; line++) { int w, x; while(1) { w = ogm_get_width( this, this->text[line]); - x = (this->width - w) / 2; - - if( w > this->width && font_size > 16 ) { + + switch (GET_X_ALIGNMENT(alignment)) { + case ALIGN_LEFT: + if (sub_x >= 0) x = sub_x; + else x = 5; + break; + + case ALIGN_RIGHT: + if (sub_x >= 0) x = sub_x - w; + else x = max_width - w - 5; + break; + + case ALIGN_CENTER: + default: + if (sub_x >= 0) x = sub_x - w / 2; + else x = (max_width - w) / 2; + break; + } + + + if( w > max_width && font_size > 16 ) { font_size -= 4; this->renderer->set_font (this->osd, get_font (this->class), font_size); } else { diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index bf0d3b7f0..932f22e3a 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -820,6 +820,14 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) { return this->sc.gui_width; case VO_PROP_WINDOW_HEIGHT: return this->sc.gui_height; + case VO_PROP_OUTPUT_WIDTH: + return this->cur_frame->sc.output_width; + case VO_PROP_OUTPUT_HEIGHT: + return this->cur_frame->sc.output_height; + case VO_PROP_OUTPUT_XOFFSET: + return this->cur_frame->sc.output_xoffset; + case VO_PROP_OUTPUT_YOFFSET: + return this->cur_frame->sc.output_yoffset; default: xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xshm: tried to get unsupported property %d\n", property); diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 7ff7b64e5..3bb0a93dc 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -871,6 +871,18 @@ static int xv_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } lprintf("video_out_xv: property #%d = %d\n", property, this->props[property].value); diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 308e809f1..4d9c80565 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -245,7 +245,11 @@ struct xine_video_port_s { #define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ #define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ #define VO_PROP_NUM_STREAMS 18 /* read-only */ -#define VO_NUM_PROPERTIES 19 +#define VO_PROP_OUTPUT_WIDTH 19 /* read-only */ +#define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */ +#define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */ +#define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */ +#define VO_NUM_PROPERTIES 23 /* number of colors in the overlay palette. Currently limited to 256 at most, because some alphablend functions use an 8-bit index into -- cgit v1.2.3 From a2d20c60cd88481989316a8cedf8bd7d1e9be94a Mon Sep 17 00:00:00 2001 From: Maximilian Schwerin Date: Thu, 27 Dec 2007 14:25:28 +0000 Subject: xmlparser: fix token buffer being too small What this patch does is replace the token buffer of static size in xml_parser_get_node with a malloced buffer. If the lexer notices, that it needs more size it just increases the size of this buffer by factor two and tries again. This may not be very elegant, but it works. node_name and property_name are dynamically-sized too. --- src/xine-utils/xmllexer.c | 15 +++++++++++-- src/xine-utils/xmllexer.h | 2 +- src/xine-utils/xmlparser.c | 52 ++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 60 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c index 047dbb1a6..a77d6654a 100644 --- a/src/xine-utils/xmllexer.c +++ b/src/xine-utils/xmllexer.c @@ -123,7 +123,10 @@ void lexer_init(const char * buf, int size) { lprintf("buffer length %d\n", size); } -int lexer_get_token(char * tok, int tok_size) { +int lexer_get_token(char ** _tok, int * _tok_size) { + char *tok = *_tok; + int tok_size = *_tok_size; + int tok_pos = 0; int state = 0; char c; @@ -455,7 +458,15 @@ int lexer_get_token(char * tok, int tok_size) { /* pb */ if (tok_pos >= tok_size) { - lprintf("token buffer is too little\n"); + *_tok_size *= 2; + *_tok = realloc (*_tok, *_tok_size); + lprintf("token buffer is too small\n"); + lprintf("increasing buffer size to %d bytes\n", *_tok_size); + if (*_tok) { + return lexer_get_token (_tok, _tok_size); + } else { + return T_ERROR; + } } else { if (lexbuf_pos >= lexbuf_size) { /* Terminate the current token */ diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h index 1e646f9b5..bf9948d2d 100644 --- a/src/xine-utils/xmllexer.h +++ b/src/xine-utils/xmllexer.h @@ -51,7 +51,7 @@ /* public functions */ void lexer_init(const char * buf, int size) XINE_PROTECTED; -int lexer_get_token(char * tok, int tok_size) XINE_PROTECTED; +int lexer_get_token(char ** tok, int * tok_size) XINE_PROTECTED; char *lexer_decode_entities (const char *tok) XINE_PROTECTED; #endif diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index a5d8212d2..3cc9bc3c2 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -153,10 +153,15 @@ void xml_parser_free_tree(xml_node_t *current_node) { #define STATE_NODE 1 #define STATE_COMMENT 7 -static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int rec) { - char tok[TOKEN_SIZE]; - char property_name[TOKEN_SIZE]; - char node_name[TOKEN_SIZE]; +static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int rec); + +static int _xml_parser_get_node (char ** token_buffer, int * token_buffer_size, + char ** pname_buffer, int * pname_buffer_size, + char ** nname_buffer, int * nname_buffer_size, + xml_node_t *current_node, char *root_name, int rec) { + char *tok = *token_buffer; + char *property_name = *pname_buffer; + char *node_name = *nname_buffer; int state = STATE_IDLE; int res = 0; int parse_res; @@ -168,9 +173,10 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r if (rec < MAX_RECURSION) { - memset (tok, 0, TOKEN_SIZE); + memset (tok, 0, *token_buffer_size); - while ((bypass_get_token) || (res = lexer_get_token(tok, TOKEN_SIZE)) != T_ERROR) { + while ((bypass_get_token) || (res = lexer_get_token(token_buffer, token_buffer_size)) != T_ERROR) { + tok = *token_buffer; bypass_get_token = 0; lprintf("info: %d - %d : '%s'\n", state, res, tok); @@ -225,6 +231,12 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) { strtoupper(tok); } + /* make sure the buffer for the node name is big enough */ + if (token_buffer_size > nname_buffer_size) { + *nname_buffer_size = *token_buffer_size; + *nname_buffer = realloc (*nname_buffer, *nname_buffer_size); + node_name = *nname_buffer; + } strcpy(node_name, tok); state = 2; lprintf("info: current node name \"%s\"\n", node_name); @@ -291,6 +303,12 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) { strtoupper(tok); } + /* make sure the buffer for the property name is big enough */ + if (token_buffer_size > pname_buffer_size) { + *pname_buffer_size = *token_buffer_size; + *pname_buffer = realloc (*pname_buffer, *pname_buffer_size); + property_name = *pname_buffer; + } strcpy(property_name, tok); state = 5; lprintf("info: current property name \"%s\"\n", property_name); @@ -452,6 +470,28 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r } } +static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int rec) +{ + int res = 0; + int token_buffer_size = TOKEN_SIZE; + int pname_buffer_size = TOKEN_SIZE; + int nname_buffer_size = TOKEN_SIZE; + char *token_buffer = xine_xmalloc (token_buffer_size); + char *pname_buffer = xine_xmalloc (pname_buffer_size); + char *nname_buffer = xine_xmalloc (nname_buffer_size); + + res = _xml_parser_get_node(&token_buffer, &token_buffer_size, + &pname_buffer, &pname_buffer_size, + &nname_buffer, &nname_buffer_size, + current_node, root_name, rec); + + free (token_buffer); + free (pname_buffer); + free (nname_buffer); + + return res; +} + int xml_parser_build_tree(xml_node_t **root_node) { xml_node_t *tmp_node; int res; -- cgit v1.2.3 From 1ea97db5f08e85e7a9da249e2061b33b93dc8e79 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 27 Dec 2007 18:24:55 +0000 Subject: Add VO_PROP_OUTPUT_* to some other video output drivers (where trivial). --- src/video_out/video_out_directfb.c | 14 +++++++++++++- src/video_out/video_out_fb.c | 14 +++++++++++++- src/video_out/video_out_sdl.c | 8 ++++++++ src/video_out/video_out_syncfb.c | 12 ++++++++++++ src/video_out/video_out_vidix.c | 12 ++++++++++++ src/video_out/video_out_xcbshm.c | 8 ++++++++ src/video_out/video_out_xcbxv.c | 12 ++++++++++++ src/video_out/video_out_xvmc.c | 12 ++++++++++++ src/video_out/video_out_xxmc.c | 12 ++++++++++++ 9 files changed, 102 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 3aa5bf66a..9786049b4 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -922,7 +922,19 @@ static int directfb_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: return this->sc.gui_height; - + + case VO_PROP_OUTPUT_WIDTH: + return this->cur_frame->sc.output_width; + + case VO_PROP_OUTPUT_HEIGHT: + return this->cur_frame->sc.output_height; + + case VO_PROP_OUTPUT_XOFFSET: + return this->cur_frame->sc.output_xoffset; + + case VO_PROP_OUTPUT_YOFFSET: + return this->cur_frame->sc.output_yoffset; + case VO_PROP_MAX_NUM_FRAMES: return (this->type & DLTF_VIDEO) ? 8 : 15; diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index 2f7fd2d57..95060a4d8 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -612,7 +612,19 @@ static int fb_get_property(vo_driver_t *this_gen, int property) case VO_PROP_WINDOW_HEIGHT: return this->sc.gui_height; - + + case VO_PROP_OUTPUT_WIDTH: + return this->cur_frame->sc.output_width; + + case VO_PROP_OUTPUT_HEIGHT: + return this->cur_frame->sc.output_height; + + case VO_PROP_OUTPUT_XOFFSET: + return this->cur_frame->sc.output_xoffset; + + case VO_PROP_OUTPUT_YOFFSET: + return this->cur_frame->sc.output_yoffset; + default: xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_fb: tried to get unsupported property %d\n", property); diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index f4f645e8c..6705b4176 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -360,6 +360,14 @@ static int sdl_get_property (vo_driver_t *this_gen, int property) { return this->sc.gui_width; case VO_PROP_WINDOW_HEIGHT: return this->sc.gui_height; + case VO_PROP_OUTPUT_WIDTH: + return this->sc.output_width; + case VO_PROP_OUTPUT_HEIGHT: + return this->sc.output_height; + case VO_PROP_OUTPUT_XOFFSET: + return this->sc.output_xoffset; + case VO_PROP_OUTPUT_YOFFSET: + return this->sc.output_yoffset; case VO_PROP_ASPECT_RATIO: return this->sc.user_ratio; } diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 86be3422e..b1fadbd58 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -670,6 +670,18 @@ static int syncfb_get_property(vo_driver_t* this_gen, int property) case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } return this->props[property].value; diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index 21e361d93..9e3f870b1 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -700,6 +700,18 @@ static int vidix_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } lprintf ("video_out_vidix: property #%d = %d\n", property, diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c index 725889d62..c9b83bb24 100644 --- a/src/video_out/video_out_xcbshm.c +++ b/src/video_out/video_out_xcbshm.c @@ -732,6 +732,14 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) { return this->sc.gui_width; case VO_PROP_WINDOW_HEIGHT: return this->sc.gui_height; + case VO_PROP_OUTPUT_WIDTH: + return this->cur_frame->sc.output_width; + case VO_PROP_OUTPUT_HEIGHT: + return this->cur_frame->sc.output_height; + case VO_PROP_OUTPUT_XOFFSET: + return this->cur_frame->sc.output_xoffset; + case VO_PROP_OUTPUT_YOFFSET: + return this->cur_frame->sc.output_yoffset; default: xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xcbshm: tried to get unsupported property %d\n", property); diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 5b44ea12d..eef61e4ea 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -771,6 +771,18 @@ static int xv_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } lprintf("video_out_xcbxv: property #%d = %d\n", property, this->props[property].value); diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 31d4c053d..d943c61b4 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -1002,6 +1002,18 @@ static int xvmc_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } return this->props[property].value; diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 2b27c3982..28679e95d 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -1760,6 +1760,18 @@ static int xxmc_get_property (vo_driver_t *this_gen, int property) { case VO_PROP_WINDOW_HEIGHT: this->props[property].value = this->sc.gui_height; break; + case VO_PROP_OUTPUT_WIDTH: + this->props[property].value = this->sc.output_width; + break; + case VO_PROP_OUTPUT_HEIGHT: + this->props[property].value = this->sc.output_height; + break; + case VO_PROP_OUTPUT_XOFFSET: + this->props[property].value = this->sc.output_xoffset; + break; + case VO_PROP_OUTPUT_YOFFSET: + this->props[property].value = this->sc.output_yoffset; + break; } lprintf("video_out_xxmc: property #%d = %d\n", property, this->props[property].value); -- cgit v1.2.3 From 38b3af7f90924773014e53ef4a3fff01572d262e Mon Sep 17 00:00:00 2001 From: Richard van Paasen Date: Sat, 22 Dec 2007 00:22:11 +0100 Subject: Fixed an input_pvr issue with 'set input' for ivtv versions 0.10.6+. ivtv now requires the video device to be re-opened when the input is changed. --- src/input/input_pvr.c | 111 ++++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index b8baffdbe..f07e98133 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -987,69 +987,74 @@ static void pvr_event_handler (pvr_input_plugin_t *this) { /* make sure we are not paused */ _x_set_speed(this->stream, XINE_SPEED_NORMAL); - if( v4l2_data->session_id != this->session ) { - /* if session changes -> closes the old one */ - pthread_mutex_lock(&this->lock); - pvr_finish_recording(this); - time(&this->start_time); - this->show_time = this->start_time; - this->session = v4l2_data->session_id; - this->new_session = 1; - this->pvr_play_paused = 0; - this->scr_tunning = 0; - pvrscr_speed_tunning(this->scr, 1.0 ); - pvr_break_rec_page(this); - pthread_mutex_unlock(&this->lock); - _x_demux_flush_engine (this->stream); - } else { - /* no session change, break the page and store a new show_time */ - pthread_mutex_lock(&this->lock); - pvr_break_rec_page(this); - this->show_page = this->rec_page; - pthread_mutex_unlock(&this->lock); - time(&this->show_time); + if ( v4l2_data->session_id != -1) { + if( v4l2_data->session_id != this->session ) { + /* if session changes -> closes the old one */ + pthread_mutex_lock(&this->lock); + pvr_finish_recording(this); + time(&this->start_time); + this->show_time = this->start_time; + this->session = v4l2_data->session_id; + this->new_session = 1; + this->pvr_play_paused = 0; + this->scr_tunning = 0; + pvrscr_speed_tunning(this->scr, 1.0 ); + pvr_break_rec_page(this); + pthread_mutex_unlock(&this->lock); + _x_demux_flush_engine (this->stream); + } else { + /* no session change, break the page and store a new show_time */ + pthread_mutex_lock(&this->lock); + pvr_break_rec_page(this); + this->show_page = this->rec_page; + pthread_mutex_unlock(&this->lock); + time(&this->show_time); + } } - - if( (v4l2_data->input != -1 && v4l2_data->input != this->input) || - (v4l2_data->channel != -1 && v4l2_data->channel != this->channel) || - (v4l2_data->frequency != -1 && v4l2_data->frequency != this->frequency) ) { - struct v4l2_frequency vf; + pthread_mutex_lock(&this->dev_lock); + + /* change input */ + if (v4l2_data->input != -1 && v4l2_data->input != this->input) { + lprintf("change input to:%d\n", v4l2_data->input); this->input = v4l2_data->input; + + /* as of ivtv 0.10.6: must close and reopen to set input */ + close(this->dev_fd); + this->dev_fd = open (this->class->devname, O_RDWR); + if (this->dev_fd == -1) { + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error opening device %s\n", this->class->devname ); + } else { + if( ioctl(this->dev_fd, VIDIOC_S_INPUT, &this->input) ) + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error setting v4l2 input\n"); + } + } + + /* change channel */ + if (v4l2_data->channel != -1 && v4l2_data->channel != this->channel) { + lprintf("change channel to:%d\n", v4l2_data->channel); this->channel = v4l2_data->channel; - this->frequency = v4l2_data->frequency; + } - lprintf("switching to input:%d chan:%d freq:%.2f\n", - v4l2_data->input, - v4l2_data->channel, - (float)v4l2_data->frequency * 62.5); - - pthread_mutex_lock(&this->dev_lock); - if( ioctl(this->dev_fd, VIDIOC_S_INPUT, &this->input) ) - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error setting v4l2 input\n"); - + /* change frequency */ + if (v4l2_data->frequency != -1 && v4l2_data->frequency != this->frequency) { + lprintf("changing frequency to:%.2f\n", (float)v4l2_data->frequency * 62.5); + struct v4l2_frequency vf; + this->frequency = v4l2_data->frequency; vf.frequency = this->frequency; vf.tuner = 0; if( ioctl(this->dev_fd, VIDIOC_S_FREQUENCY, &vf) ) - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error setting v4l2 frequency\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "input_pvr: error setting v4l2 frequency\n"); + } - /* workaround an ivtv bug where stream gets bad mpeg2 artifacts - * after changing inputs. reopening the device fixes it. - */ - close(this->dev_fd); - this->dev_fd = open (this->class->devname, O_RDWR); - if (this->dev_fd == -1) { - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "input_pvr: error opening device %s\n", this->class->devname ); - return; - } - pthread_mutex_unlock(&this->dev_lock); + pthread_mutex_unlock(&this->dev_lock); - /* FIXME: also flush the device */ - /* _x_demux_flush_engine(this->stream); */ - } + /* FIXME: also flush the device */ + /* _x_demux_flush_engine(this->stream); */ + break; -- cgit v1.2.3 From 3c7b43e32e0d128e13a693cb45790927ebf3edd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 29 Dec 2007 22:29:09 +0100 Subject: Only check for the chunk's size to be lesser than 100 when reading the COMM_TAG. This way, bigger audio chunks won't make the demuxer fail. Fixes bug #6. --- src/demuxers/demux_aiff.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 7fcaea70e..3f2d0df11 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -87,7 +87,6 @@ static int open_aiff_file(demux_aiff_t *this) { unsigned char preamble[PREAMBLE_SIZE]; unsigned int chunk_type; unsigned int chunk_size; - unsigned char buffer[100]; if (_x_demux_read_header(this->input, signature, AIFF_SIGNATURE_SIZE) != AIFF_SIGNATURE_SIZE) return 0; @@ -118,13 +117,15 @@ static int open_aiff_file(demux_aiff_t *this) { chunk_type = _X_BE_32(&preamble[0]); chunk_size = _X_BE_32(&preamble[4]); - if (chunk_size > sizeof(buffer) / sizeof(buffer[0])) { - /* the chunk is too large to fit in the buffer -> this cannot be an aiff chunk */ - this->status = DEMUX_FINISHED; - return 0; - } - if (chunk_type == COMM_TAG) { + unsigned char buffer[100]; + + if (chunk_size > sizeof(buffer) / sizeof(buffer[0])) { + /* the chunk is too large to fit in the buffer -> this cannot be an aiff chunk */ + this->status = DEMUX_FINISHED; + return 0; + } + if (this->input->read(this->input, buffer, chunk_size) != chunk_size) { this->status = DEMUX_FINISHED; -- cgit v1.2.3 From 8d06b568011b991efcd8c2ddc9afe5386901683d Mon Sep 17 00:00:00 2001 From: Philippe Troin Date: Sat, 29 Dec 2007 14:28:01 +0000 Subject: Crashes when accessing files via Gnome-VFS /usr/bin/totem-video-thumbnailer -s 128 ssh://user@hosts/path/to/video.ext Will segfault. All the time. --HG-- extra : transplant_source : H%1EU%A5%3C%E6r%976%AA%C3%92%E5l%C7w%92dg. --- src/input/input_gnome_vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c index ba42a02d4..0848b9206 100644 --- a/src/input/input_gnome_vfs.c +++ b/src/input/input_gnome_vfs.c @@ -199,7 +199,7 @@ gnomevfs_plugin_get_length (input_plugin_t *this_gen) static uint32_t gnomevfs_plugin_get_blocksize (input_plugin_t *this_gen) { - return 32 * 1024; + return 8 * 1024; } static const char* -- cgit v1.2.3 From aa3d3aacdb991ad989933d71734e300535c7d350 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 30 Dec 2007 17:23:50 +0000 Subject: Dereference buffer size pointers when comparing buffer sizes. --- src/xine-utils/xmlparser.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index 3cc9bc3c2..cc2bfe462 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -231,12 +231,12 @@ static int _xml_parser_get_node (char ** token_buffer, int * token_buffer_size, if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) { strtoupper(tok); } - /* make sure the buffer for the node name is big enough */ - if (token_buffer_size > nname_buffer_size) { - *nname_buffer_size = *token_buffer_size; - *nname_buffer = realloc (*nname_buffer, *nname_buffer_size); - node_name = *nname_buffer; - } + /* make sure the buffer for the node name is big enough */ + if (*token_buffer_size > *nname_buffer_size) { + *nname_buffer_size = *token_buffer_size; + *nname_buffer = realloc (*nname_buffer, *nname_buffer_size); + node_name = *nname_buffer; + } strcpy(node_name, tok); state = 2; lprintf("info: current node name \"%s\"\n", node_name); @@ -303,12 +303,12 @@ static int _xml_parser_get_node (char ** token_buffer, int * token_buffer_size, if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) { strtoupper(tok); } - /* make sure the buffer for the property name is big enough */ - if (token_buffer_size > pname_buffer_size) { - *pname_buffer_size = *token_buffer_size; - *pname_buffer = realloc (*pname_buffer, *pname_buffer_size); - property_name = *pname_buffer; - } + /* make sure the buffer for the property name is big enough */ + if (*token_buffer_size > *pname_buffer_size) { + *pname_buffer_size = *token_buffer_size; + *pname_buffer = realloc (*pname_buffer, *pname_buffer_size); + property_name = *pname_buffer; + } strcpy(property_name, tok); state = 5; lprintf("info: current property name \"%s\"\n", property_name); -- cgit v1.2.3