From: Darren S. <li...@yo...> - 2009-11-30 21:59:41
|
# [node 71245c945c1ab1d9a525d209a340a6e9688b42a6 part 8] diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c --- a/src/video_out/yuv2rgb_mmx.c +++ b/src/video_out/yuv2rgb_mmx.c @@ -182,7 +182,7 @@ pmulhw_m2r (csc->V_green, mm4); // mm4 = v * v_green - + // slot @@ -406,7 +406,7 @@ pand_m2r (mmx_lorgb, mm6); psrlq_i2r (8, mm5); por_r2r(mm6, mm5); /* mm5 = 0x0000R1G1B1R0G0B0 */ - + movq_r2r (mm0, mm6); punpcklbw_r2r (mm2, mm6); punpckhwd_r2r (mm7, mm6); /* mm6 = 0x??R3G3B3??R2G2B2 */ @@ -481,13 +481,13 @@ i = width; img = image; do { mmx_yuv2rgb (py, pu, pv, this->table_mmx); - mmx_unpack_16rgb (img, cpu); + mmx_unpack_16rgb (img, cpu); py += 8; pu += 4; pv += 4; img += 16; } while (--i); - + py += y_stride; image += rgb_stride; if (height & 1) { @@ -509,7 +509,7 @@ this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, this->dest_width >> 1, this->step_dx); - scale_line (py, this->y_buffer, + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); dst_height = this->next_slice (this, &image); @@ -525,19 +525,19 @@ /* printf ("i : %d\n",i); */ mmx_yuv2rgb (y_buf, u_buf, v_buf, this->table_mmx); - mmx_unpack_16rgb (img, cpu); + mmx_unpack_16rgb (img, cpu); y_buf += 8; u_buf += 4; v_buf += 4; img += 16; } while (--i); - + dy += this->step_dy; image += rgb_stride; while (--dst_height > 0 && dy < 32768) { - xine_fast_memcpy (image, image-rgb_stride, this->dest_width*2); + xine_fast_memcpy (image, image-rgb_stride, this->dest_width*2); dy += this->step_dy; image += rgb_stride; @@ -551,23 +551,23 @@ py += y_stride; - scale_line (py, this->y_buffer, + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); if (height & 1) { pu += uv_stride; pv += uv_stride; - + scale_line (pu, this->u_buffer, this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, this->dest_width >> 1, this->step_dx); - + } height++; } while( dy>=32768); } - } + } } static inline void yuv420_rgb15 (yuv2rgb_t *this, @@ -594,13 +594,13 @@ i = width; img = image; do { mmx_yuv2rgb (py, pu, pv, this->table_mmx); - mmx_unpack_15rgb (img, cpu); + mmx_unpack_15rgb (img, cpu); py += 8; pu += 4; pv += 4; img += 16; } while (--i); - + py += y_stride; image += rgb_stride; if (height & 1) { @@ -622,11 +622,11 @@ this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, this->dest_width >> 1, this->step_dx); - scale_line (py, this->y_buffer, + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); - + dst_height = this->next_slice (this, &image); - + for (height = 0;; ) { y_buf = this->y_buffer; [... 121 lines omitted ...] - mmx_unpack_32rgb (img, cpu); + mmx_unpack_32rgb (img, cpu); y_buf += 8; u_buf += 4; v_buf += 4; img += 32; } while (--i); - + dy += this->step_dy; image += rgb_stride; while (--dst_height > 0 && dy < 32768) { - xine_fast_memcpy (image, image-rgb_stride, this->dest_width*4); + xine_fast_memcpy (image, image-rgb_stride, this->dest_width*4); dy += this->step_dy; image += rgb_stride; @@ -885,14 +885,14 @@ do { dy -= 32768; py += y_stride; - - scale_line (py, this->y_buffer, + + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); if (height & 1) { pu += uv_stride; pv += uv_stride; - + scale_line (pu, this->u_buffer, this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, @@ -901,7 +901,7 @@ height++; } while( dy>=32768 ); } - + } } @@ -955,11 +955,11 @@ this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, this->dest_width >> 1, this->step_dx); - scale_line (py, this->y_buffer, + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); dst_height = this->next_slice (this, &image); - + for (height = 0;; ) { y_buf = this->y_buffer; @@ -972,19 +972,19 @@ /* printf ("i : %d\n",i); */ mmx_yuv2rgb (y_buf, u_buf, v_buf, this->table_mmx); - mmx_unpack_32bgr (img, cpu); + mmx_unpack_32bgr (img, cpu); y_buf += 8; u_buf += 4; v_buf += 4; img += 32; } while (--i); - + dy += this->step_dy; image += rgb_stride; while (--dst_height > 0 && dy < 32768) { - xine_fast_memcpy (image, image-rgb_stride, this->dest_width*4); + xine_fast_memcpy (image, image-rgb_stride, this->dest_width*4); dy += this->step_dy; image += rgb_stride; @@ -996,14 +996,14 @@ do { dy -= 32768; py += y_stride; - - scale_line (py, this->y_buffer, + + scale_line (py, this->y_buffer, this->dest_width, this->step_dx); if (height & 1) { pu += uv_stride; pv += uv_stride; - + scale_line (pu, this->u_buffer, this->dest_width >> 1, this->step_dx); scale_line (pv, this->v_buffer, @@ -1013,7 +1013,7 @@ } while( dy>=32768 ); } - + } } @@ -1089,7 +1089,7 @@ void yuv2rgb_init_mmxext (yuv2rgb_factory_t *this) { - if (this->swapped) + if (this->swapped) return; /*no swapped pixel output upto now*/ switch (this->mode) { @@ -1113,7 +1113,7 @@ void yuv2rgb_init_mmx (yuv2rgb_factory_t *this) { - if (this->swapped) + if (this->swapped) return; /*no swapped pixel output upto now*/ switch (this->mode) { diff --git a/src/xine-engine/accel_xvmc.h b/src/xine-engine/accel_xvmc.h --- a/src/xine-engine/accel_xvmc.h +++ b/src/xine-engine/accel_xvmc.h @@ -3,23 +3,23 @@ * Copyright (C) 2004 the Unichrome project * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * - * Common acceleration definitions for XvMC. + * Common acceleration definitions for XvMC. * * */ @@ -85,7 +85,7 @@ */ xine_xvmc_t xvmc; - + unsigned mpeg; unsigned acceleration; int fallback_format; @@ -107,7 +107,7 @@ * For thread-safety only. */ - int (*proc_xxmc_lock_valid) (vo_frame_t *cur_frame, vo_frame_t *fw_frame, + int (*proc_xxmc_lock_valid) (vo_frame_t *cur_frame, vo_frame_t *fw_frame, vo_frame_t *bw_frame,unsigned pc_type); void (*proc_xxmc_unlock) (vo_driver_t *this_gen); } xine_xxmc_t; diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1,7 +1,7 @@ /* * * Copyright (C) James Courtier-Dutton Ja...@su... - July 2001 - * + * * Copyright (C) 2000 Thomas Mirlacher * 2002-2004 the xine project * @@ -114,7 +114,7 @@ /* * heck, this function is overly complicated and currently buggy. - * if James would like to revive it (implementing proper clipping - + * if James would like to revive it (implementing proper clipping - * not to confuse with button highlight) i would have no objections, * but for now i will be using an alternate version based on rgb24. [MF] * @@ -181,7 +181,7 @@ printf("blend_rgb16: dy_step=%i, x_scale=%i\n", dy_step, x_scale); #endif if (img_width & 1) img_width++; - img_offset = ( ( (y_off * img_height) / dst_height) * img_width) + img_offset = ( ( (y_off * img_height) / dst_height) * img_width) + ( (x_off * img_width) / dst_width); #ifdef LOG_BLEND_RGB16 printf("blend_rgb16: x=%i, y=%i, w=%i, h=%i, img_offset=%lf\n", img_overl->x, img_overl->y, @@ -190,7 +190,7 @@ img_offset); #endif img_pix = (uint16_t *) img + (int)img_offset; -/* +/* + (y_off * img_height / dst_height) * img_width + (x_off * img_width / dst_width); */ @@ -200,26 +200,26 @@ clip_right = src_width; else clip_right = dst_width - x_off; - + if( x_off >= 0 ) clip_left = 0; else clip_left = -x_off; - + if( y_off >= 0 ) clip_top = 0; else clip_top = -y_off; - + if( (src_height + y_off) > dst_height ) src_height = dst_height - y_off; - + /* make highlight area fit into clip area */ if( img_overl->hili_right <= clip_right ) hili_right = img_overl->hili_right; else hili_right = clip_right; - + if( img_overl->hili_left >= clip_left ) hili_left = img_overl->hili_left; else @@ -233,7 +233,7 @@ x = x1_scaled = x2_scaled = 0; #ifdef LOG_BLEND_RGB16 - printf("blend_rgb16 started\n"); + printf("blend_rgb16 started\n"); #endif while (zone_state != 6) { @@ -287,10 +287,10 @@ mem_blend16(img_pix+x1_scaled, *((uint16_t *)&clut[clr]), o, x2_scaled-x1_scaled); } x += rle_this_bite; - if (x >= src_width ) { + if (x >= src_width ) { x -= src_width; img_pix += img_width; - + dy += dy_step; if (dy >= INT_TO_SCALED(1)) { dy -= INT_TO_SCALED(1); @@ -304,7 +304,7 @@ } else { rle = rle_start; /* y-scaling, reuse the last rle encoded line */ } - } + } rle_remainder = rlelen = rle->len; clr_next = rle->color; rle++; @@ -345,7 +345,7 @@ mem_blend16(img_pix+x1_scaled, *((uint16_t *)&clut[clr]), o, x2_scaled-x1_scaled); } x += rle_this_bite; - if (x >= src_width ) { + if (x >= src_width ) { x -= src_width; img_pix += img_width; dy += dy_step; @@ -390,7 +390,7 @@ mem_blend16(img_pix+x1_scaled, *((uint16_t *)&clut[clr]), o, x2_scaled-x1_scaled); } x += rle_this_bite; - if (x >= src_width ) { + if (x >= src_width ) { x -= src_width; img_pix += img_width; dy += dy_step; @@ -410,7 +410,7 @@ zone_state = 5; break; } - } + } if (rle >= rle_limit) { zone_state = 6; [... 853 lines omitted ...] void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette, unsigned first_xx44_entry, unsigned num_xx44_entries, - unsigned num_xvmc_components, char *xvmc_components) + unsigned num_xvmc_components, char *xvmc_components) { register unsigned int i; register const uint32_t *cluts = p->cluts + first_xx44_entry; @@ -1946,16 +1946,16 @@ xvmc_palette += num_xvmc_components; } } -} +} -static int xx44_paletteIndex(xx44_palette_t *p, int color, uint32_t clut) +static int xx44_paletteIndex(xx44_palette_t *p, int color, uint32_t clut) { register unsigned int i; register uint32_t *cluts = p->cluts; register int tmp; - if ((tmp = p->lookup_cache[color]) >= 0) + if ((tmp = p->lookup_cache[color]) >= 0) if (cluts[tmp] == clut) return tmp; for (i=0; i<p->max_used; ++i) { @@ -1972,7 +1972,7 @@ static void memblend_xx44(uint8_t *mem,uint8_t val, register size_t size, uint8_t mask) { - register uint8_t + register uint8_t masked_val; if (0 == (masked_val = val & mask)) return; @@ -1984,16 +1984,16 @@ } void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl, - int dst_width, int dst_height, int dst_pitch, + int dst_width, int dst_height, int dst_pitch, alphablend_t *extra_data, - xx44_palette_t *palette,int ia44) + xx44_palette_t *palette,int ia44) { int src_width, src_height; rle_elem_t *rle, *rle_limit; int mask; int x_off, y_off; int x, y; - uint8_t norm_pixel,hili_pixel; + uint8_t norm_pixel,hili_pixel; uint8_t *dst_y; uint8_t *dst; uint8_t alphamask = (ia44) ? 0x0F : 0xF0; @@ -2017,26 +2017,26 @@ clip_right = src_width; else clip_right = dst_width - x_off; - + if( x_off >= 0 ) clip_left = 0; else clip_left = -x_off; - + if( y_off >= 0 ) clip_top = 0; else clip_top = -y_off; - + if( (src_height + y_off) > dst_height ) src_height = dst_height - y_off; - + /* make highlight area fit into clip area */ if( img_overl->hili_right <= clip_right ) hili_right = img_overl->hili_right; else hili_right = clip_right; - + if( img_overl->hili_left >= clip_left ) hili_left = img_overl->hili_left; else @@ -2053,10 +2053,10 @@ if (len > 0) { norm_pixel = (uint8_t)((xx44_paletteIndex(palette,rle->color, - img_overl->color[rle->color]) << 4) | + img_overl->color[rle->color]) << 4) | (img_overl->trans[rle->color] & 0x0F)); hili_pixel = (uint8_t)((xx44_paletteIndex(palette,rle->color+OVL_PALETTE_SIZE, - img_overl->hili_color[rle->color]) << 4) | + img_overl->hili_color[rle->color]) << 4) | (img_overl->hili_trans[rle->color] & 0x0F)); if (!ia44) { norm_pixel = ((norm_pixel & 0x0F) << 4) | ((norm_pixel & 0xF0) >> 4); @@ -2091,7 +2091,7 @@ dst += len; } } - } else if (x < hili_right) { + } else if (x < hili_right) { if (len <= hili_right - x) { if(!clipped) memblend_xx44(dst,hili_pixel,len, alphamask); @@ -2123,7 +2123,7 @@ x += rle->len; rle++; if (rle >= rle_limit) break; - } + } if (rle >= rle_limit) break; dst_y += dst_pitch; } @@ -2139,7 +2139,7 @@ void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) { config_values_t *config = xine->config; - + extra_data->buffer = 0; extra_data->buffer_size = 0; extra_data->offset_x = 0; diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2005 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -60,18 +60,18 @@ while (running) { - lprintf ("audio_loop: waiting for package...\n"); + lprintf ("audio_loop: waiting for package...\n"); if( !replaying_headers ) buf = stream->audio_fifo->get (stream->audio_fifo); - lprintf ("audio_loop: got package pts = %"PRId64", type = %08x\n", buf->pts, buf->type); + lprintf ("audio_loop: got package pts = %"PRId64", type = %08x\n", buf->pts, buf->type); _x_extra_info_merge( stream->audio_decoder_extra_info, buf->extra_info ); stream->audio_decoder_extra_info->seek_count = stream->video_seek_count; - + switch (buf->type) { - + case BUF_CONTROL_HEADERS_DONE: pthread_mutex_lock (&stream->counter_lock); stream->header_count_audio++; @@ -85,11 +85,11 @@ /* decoder dispose might call port functions */ running_ticket->acquire(running_ticket, 0); - + if (stream->audio_decoder_plugin) { lprintf ("close old decoder\n"); - + stream->keep_ao_driver_open = !!(buf->decoder_flags & BUF_FLAG_GAPLESS_SW); _x_free_audio_decoder (stream, stream->audio_decoder_plugin); stream->audio_decoder_plugin = NULL; @@ -97,15 +97,15 @@ stream->audio_type = 0; stream->keep_ao_driver_open = 0; } - + running_ticket->release(running_ticket, 0); - + if( !(buf->decoder_flags & BUF_FLAG_GAPLESS_SW) ) stream->metronom->handle_audio_discontinuity (stream->metronom, DISC_STREAMSTART, 0); - + buftype_unknown = 0; break; - + case BUF_CONTROL_END: /* free all held header buffers, see comments below */ @@ -128,12 +128,12 @@ */ while(1) { int num_bufs, num_streams; - + running_ticket->acquire(running_ticket, 0); num_bufs = stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_IN_FIFO); num_streams = stream->audio_out->get_property(stream->audio_out, AO_PROP_NUM_STREAMS); running_ticket->release(running_ticket, 0); - + if( num_bufs > 0 && num_streams == 1 && !stream->early_finish_event) xine_usec_sleep (10000); else @@ -144,7 +144,7 @@ pthread_mutex_lock (&stream->counter_lock); stream->finished_count_audio++; - + lprintf ("reached end marker # %d\n", stream->finished_count_audio); pthread_cond_broadcast (&stream->counter_changed); @@ -164,18 +164,18 @@ stream->audio_channel_auto = -1; break; - + case BUF_CONTROL_QUIT: /* decoder dispose might call port functions */ running_ticket->acquire(running_ticket, 0); - + if (stream->audio_decoder_plugin) { _x_free_audio_decoder (stream, stream->audio_decoder_plugin); stream->audio_decoder_plugin = NULL; stream->audio_track_map_entries = 0; stream->audio_type = 0; } - + running_ticket->release(running_ticket, 0); running = 0; [... 138 lines omitted ...] _("audio_decoder: no plugin available to handle '%s'\n"), _x_buf_audio_name( buf->type ) ); - + if( !_x_meta_info_get(stream, XINE_META_INFO_AUDIOCODEC) ) _x_meta_info_set_utf8(stream, XINE_META_INFO_AUDIOCODEC, _x_buf_audio_name( buf->type )); - + buftype_unknown = buf->type; - /* fatal error - dispose plugin */ + /* fatal error - dispose plugin */ if (stream->audio_decoder_plugin) { _x_free_audio_decoder (stream, stream->audio_decoder_plugin); stream->audio_decoder_plugin = NULL; @@ -380,7 +380,7 @@ } } } else if( buf->type != buftype_unknown ) { - xine_log (stream->xine, XINE_LOG_MSG, + xine_log (stream->xine, XINE_LOG_MSG, _("audio_decoder: error, unknown buffer type: %08x\n"), buf->type ); buftype_unknown = buf->type; } @@ -388,14 +388,14 @@ if (running_ticket->ticket_revoked) running_ticket->renew(running_ticket, 0); running_ticket->release(running_ticket, 0); - + xine_profiler_stop_count (prof_audio_decode); } /* some decoders require a full reinitialization when audio * channel is changed (rate might be change and even a - * different codec may be used). - * + * different codec may be used). + * * we must close the old decoder and process all the headers * again, since they are needed for decoder initialization. */ @@ -408,7 +408,7 @@ running_ticket->acquire(running_ticket, 0); _x_free_audio_decoder (stream, stream->audio_decoder_plugin); running_ticket->release(running_ticket, 0); - + stream->audio_decoder_plugin = NULL; stream->audio_track_map_entries = 0; stream->audio_type = 0; @@ -456,7 +456,7 @@ } first_header = last_header = NULL; } - + return NULL; } @@ -471,7 +471,7 @@ return 1; } else { int num_buffers; - + /* The fifo size is based on dvd playback where buffers are filled * with 2k of data. With 230 buffers and a typical audio data rate * of 1.8 Mbit/s (four ac3 streams), the fifo can hold about 2 seconds @@ -479,7 +479,7 @@ * We provide buffers of 8k size instead of 2k for demuxers sending * larger chunks. */ - + num_buffers = stream->xine->config->register_num (stream->xine->config, "engine.buffers.audio_num_buffers", 230, @@ -489,7 +489,7 @@ "mean smoother playback for unreliable inputs, but " "also increased latency and memory consumption."), 20, NULL, NULL); - + stream->audio_fifo = _x_fifo_buffer_new (num_buffers, 8192); stream->audio_channel_user = -1; stream->audio_channel_auto = -1; @@ -505,17 +505,17 @@ pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&pth_attrs, &pth_params); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); - - stream->audio_thread_created = 1; + + stream->audio_thread_created = 1; if ((err = pthread_create (&stream->audio_thread, &pth_attrs, audio_decoder_loop, stream)) != 0) { - xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "audio_decoder: can't create new thread (%s)\n", strerror(err)); stream->audio_thread_created = 0; pthread_attr_destroy(&pth_attrs); return 0; } - + pthread_attr_destroy(&pth_attrs); } return 1; @@ -532,16 +532,16 @@ buf = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo); buf->type = BUF_CONTROL_QUIT; stream->audio_fifo->put (stream->audio_fifo, buf); - + pthread_join (stream->audio_thread, &p); stream->audio_thread_created = 0; } - + stream->audio_fifo->dispose (stream->audio_fifo); stream->audio_fifo = NULL; } int _x_get_audio_channel (xine_stream_t *stream) { - return stream->audio_type & 0xFFFF; + return stream->audio_type & 0xFFFF; } diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2006 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with self program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -102,7 +102,7 @@ #define ZERO_BUF_SIZE 5000 /* By adding gap errors (difference between reported and expected - * sound card clock) into metronom's vpts_offset we can use its + * sound card clock) into metronom's vpts_offset we can use its * smoothing algorithms to correct sound card clock drifts. * obs: previously this error was added to xine scr. * @@ -158,13 +158,13 @@ #define EQ_BANDS 10 #define EQ_CHANNELS 8 -#define FP_FRBITS 28 +#define FP_FRBITS 28 #define EQ_REAL(x) ((int)((x) * (1 << FP_FRBITS))) typedef struct { int beta; - int alpha; + int alpha; int gamma; } sIIRCoefficients; @@ -197,15 +197,15 @@ /* 16k Hz*/ { EQ_REAL(2.4201241845e-01), EQ_REAL(3.7899379077e-01), EQ_REAL(-8.0847117831e-01) }, }; - + typedef struct { - + xine_audio_port_t ao; /* public part */ /* private stuff */ ao_driver_t *driver; pthread_mutex_t driver_lock; - + uint32_t driver_open:1; uint32_t audio_loop_running:1; uint32_t audio_thread_created:1; @@ -230,7 +230,7 @@ int64_t audio_step; /* pts per 32 768 samples (sample = #bytes/2) */ int32_t frames_per_kpts; /* frames per 1024/90000 sec */ - + int av_sync_method_conf; resample_sync_t resample_sync_info; double resample_sync_factor; /* correct buffer length by this factor @@ -253,7 +253,7 @@ /* FIXME: replace all this->clock->speed with this->current_speed. we should make * sure nobody will change speed without going through xine.c:set_speed_internal */ int slow_fast_audio; /* play audio even on slow/fast speeds */ - + int16_t last_sample[RESAMPLE_MAX_CHANNELS]; audio_buffer_t *frame_buf[2]; /* two buffers for "stackable" conversions */ int16_t *zero_space; @@ -279,7 +279,7 @@ int eq_k; sXYData eq_data_history[EQ_BANDS][EQ_CHANNELS]; - + } aos_t; struct audio_fifo_s { @@ -444,7 +444,7 @@ } -static void write_pause_burst(aos_t *this, uint32_t num_frames) { +static void write_pause_burst(aos_t *this, uint32_t num_frames) { uint16_t sbuf[4096]; sbuf[0] = 0xf872; @@ -474,7 +474,7 @@ if ((this->output.mode == AO_CAP_MODE_A52) || (this->output.mode == AO_CAP_MODE_AC5)) { write_pause_burst(this,num_frames); - return; + return; } while (num_frames > 0 && !this->discard_buffers) { @@ -498,7 +498,7 @@ int frames) { int size = bytes_per_frame * frames; - + if (buf->mem_size < size) { buf->mem = realloc( buf->mem, size ); buf->mem_size = size; @@ -529,7 +529,7 @@ return 6; } return 0; [... 617 lines omitted ...] xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) { - + config_values_t *config = xine->config; aos_t *this; int i, err; @@ -2084,7 +2084,7 @@ this->clock = xine->clock; this->current_speed = xine->clock->speed; this->streams = xine_list_new(); - + /* warning: driver_lock is a recursive mutex. it must NOT be * used with neither pthread_cond_wait() or pthread_cond_timedwait() */ @@ -2108,13 +2108,13 @@ this->ao.flush = ao_flush; this->ao.status = ao_status; - this->num_driver_actions = 0; + this->num_driver_actions = 0; this->audio_loop_running = 0; this->grab_only = grab_only; this->flush_audio_driver = 0; this->discard_buffers = 0; this->zero_space = calloc (1, ZERO_BUF_SIZE * 4 * 6); /* MAX as 32bit, 6 channels. */ - + pthread_mutex_init( &this->current_speed_lock, NULL ); pthread_mutex_init( &this->flush_audio_driver_lock, NULL ); pthread_cond_init( &this->flush_audio_driver_reached, NULL ); @@ -2150,7 +2150,7 @@ "an external decoder in digital form."), 20, ao_update_av_sync_method, this); config->update_num(config,"audio.synchronization.av_sync_method",this->av_sync_method_conf); - + this->resample_conf = config->register_enum (config, "audio.synchronization.resample_mode", 0, resample_modes, _("enable resampling"), @@ -2177,7 +2177,7 @@ "a fixed offset here to compensate.\nThe unit of " "the value is one PTS tick, which is the 90000th " "part of a second."), 10, NULL, NULL); - + this->slow_fast_audio = config->register_bool (config, "audio.synchronization.slow_fast_audio", 0, @@ -2229,12 +2229,12 @@ buf->mem = calloc (1, AUDIO_BUF_SIZE); buf->mem_size = AUDIO_BUF_SIZE; buf->extra_info = malloc(sizeof(extra_info_t)); - + fifo_append (this->free_fifo, buf); } memset (this->last_sample, 0, sizeof (this->last_sample)); - + /* buffers used for audio conversions */ for (i=0; i<2; i++) { @@ -2253,13 +2253,13 @@ */ if(this->driver){ int vol; - - vol = config->register_range (config, "audio.volume.mixer_volume", - 50, 0, 100, _("startup audio volume"), + + vol = config->register_range (config, "audio.volume.mixer_volume", + 50, 0, 100, _("startup audio volume"), _("The overall audio volume set at xine startup."), 10, NULL, NULL); - + if(config->register_bool (config, "audio.volume.remember_volume", 0, - _("restore volume level at startup"), + _("restore volume level at startup"), _("If disabled, xine will not modify any mixer settings at startup."), 10, NULL, NULL)) { int prop = 0; @@ -2268,34 +2268,34 @@ prop = AO_PROP_MIXER_VOL; else if((ao_get_capabilities(&this->ao)) & AO_CAP_PCM_VOL) prop = AO_PROP_PCM_VOL; - + ao_set_property(&this->ao, prop, vol); } - } - + } + if (!this->grab_only) { /* * start output thread */ - this->audio_loop_running = 1; - + this->audio_loop_running = 1; + pthread_attr_init(&pth_attrs); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); this->audio_thread_created = 1; if ((err = pthread_create (&this->audio_thread, &pth_attrs, ao_loop, this)) != 0) { - + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: can't create thread (%s)\n", strerror(err)); - xprintf (this->xine, XINE_VERBOSITY_LOG, + xprintf (this->xine, XINE_VERBOSITY_LOG, _("audio_out: sorry, this should not happen. please restart xine.\n")); _x_abort(); - + } else xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: thread created\n"); - + pthread_attr_destroy(&pth_attrs); } diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -9,7 +9,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -27,7 +27,7 @@ * - master will wait for connections on specified port, accepting new clients. * - several xine clients may connect to the server as "slaves", using mrl: * slave://master_address:port - * - streams played on master will appear on every slave. + * - streams played on master will appear on every slave. * if master is not meant to use video/audio devices it may be started with * 'xine -V none -A none' */ @@ -73,7 +73,7 @@ int port; /* server port */ int msock; /* master network socket */ xine_list_t *connections; /* active connections */ - + pthread_t manager_thread; pthread_mutex_t lock; @@ -87,21 +87,21 @@ fd_set readfds, writefds, exceptfds; int retval; struct timeval timeout; - + for(;;) { - FD_ZERO(&readfds); - FD_ZERO(&writefds); + FD_ZERO(&readfds); + FD_ZERO(&writefds); FD_ZERO(&exceptfds); FD_SET(socket, &exceptfds); - - timeout.tv_sec = 0; + + timeout.tv_sec = 0; timeout.tv_usec = 0; - + retval = select(socket + 1, &readfds, &writefds, &exceptfds, &timeout); - + if(retval == -1 && (errno != EAGAIN && errno != EINTR)) return 0; - + if (retval != -1) return 1; } @@ -116,21 +116,21 @@ ssize_t size; int wlen = 0; uint8_t *buf = buf_gen; - + if((socket < 0) || (buf == NULL)) return -1; - + if(!sock_check_opened(socket)) return -1; - + while(len) { size = write(socket, buf, len); - + if(size <= 0) { xprintf(xine, XINE_VERBOSITY_DEBUG, "broadcaster: error writing to socket %d\n",socket); return -1; } - + len -= size; wlen += size; buf += size; @@ -143,20 +143,20 @@ sock_string_write(xine_t *xine, int socket, const char *msg, ...) { char buf[_BUFSIZ]; va_list args; - + va_start(args, msg); vsnprintf(buf, _BUFSIZ - 1, msg, args); va_end(args); - + /* Each line sent is '\n' terminated */ if((buf[strlen(buf)] == '\0') && (buf[strlen(buf) - 1] != '\n')) strcat(buf, "\n"); - + return sock_data_write(xine, socket, buf, strlen(buf)); } /* - * this is the most important broadcaster function. + * this is the most important broadcaster function. * it sends data to every connected client (slaves). */ static void broadcaster_data_write(broadcaster_t *this, void *buf, int len) { @@ -166,9 +166,9 @@ while (ite) { int *psock = xine_list_get_value(this->connections, ite); - + ite = xine_list_next(this->connections, ite); - + /* in case of failure remove from list */ if( sock_data_write(this->stream->xine, *psock, buf, len) < 0 ) { @@ -185,15 +185,15 @@ broadcaster_string_write(broadcaster_t *this, const char *msg, ...) { char buf[_BUFSIZ]; va_list args; [... 29 lines omitted ...] - + pthread_mutex_lock( &this->lock ); - + if (FD_ISSET(this->msock, &rfds)) { int ssock; alen = sizeof(fsin.in); - + ssock = accept(this->msock, &(fsin.sa), &alen); if (ssock >= 0) { /* identification string, helps demuxer probing */ if( sock_string_write(this->stream->xine, ssock,"master xine v1") > 0 ) { int *psock = malloc(sizeof(int)); *psock = ssock; - - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: new connection socket %d\n", *psock); xine_list_push_back(this->connections, psock); } } } - + pthread_mutex_unlock( &this->lock ); } } - + return NULL; } @@ -254,7 +254,7 @@ */ static void send_buf (broadcaster_t *this, const char *from, buf_element_t *buf) { int i; - + /* ignore END buffers since they would stop the slavery */ if( buf->type == BUF_CONTROL_END ) return; @@ -273,7 +273,7 @@ broadcaster_data_write(this, buf->decoder_info_ptr[i], buf->decoder_info[i]); } } - + broadcaster_string_write(this, "buffer fifo=%s size=%d type=%u pts=%"PRId64" disc=%"PRId64" flags=%u", from, buf->size, buf->type, buf->pts, buf->disc_off, buf->decoder_flags ); @@ -307,7 +307,7 @@ struct sockaddr sa; } servAddr; int msock, err; - + msock = socket(PF_INET, SOCK_STREAM, 0); if( msock < 0 ) { @@ -325,7 +325,7 @@ } listen(msock,QLEN); - + signal( SIGPIPE, SIG_IGN ); this = calloc(1, sizeof(broadcaster_t)); @@ -333,23 +333,23 @@ this->stream = stream; this->msock = msock; this->connections = xine_list_new(); - + pthread_mutex_init (&this->lock, NULL); - + stream->video_fifo->register_put_cb(stream->video_fifo, video_put_cb, this); if(stream->audio_fifo) stream->audio_fifo->register_put_cb(stream->audio_fifo, audio_put_cb, this); - + this->running = 1; if ((err = pthread_create (&this->manager_thread, NULL, manager_loop, (void *)this)) != 0) { - xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: can't create new thread (%s)\n", strerror(err)); _x_abort(); } - - return this; + + return this; } void _x_close_broadcaster(broadcaster_t *this) @@ -358,15 +358,15 @@ pthread_cancel(this->manager_thread); pthread_join(this->manager_thread,NULL); close(this->msock); - + if (this->stream->video_fifo) this->stream->video_fifo->unregister_put_cb(this->stream->video_fifo, video_put_cb); if(this->stream->audio_fifo) this->stream->audio_fifo->unregister_put_cb(this->stream->audio_fifo, audio_put_cb); - + xine_list_iterator_t ite; - + while ( (ite = xine_list_front(this->connections)) ) { int *psock = xine_list_get_value(this->connections, ite); xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: closing socket %d\n", *psock); @@ -383,5 +383,5 @@ int _x_get_broadcaster_port(broadcaster_t *this) { - return this->port; + return this->port; } diff --git a/src/xine-engine/bswap.h b/src/xine-engine/bswap.h --- a/src/xine-engine/bswap.h +++ b/src/xine-engine/bswap.h @@ -23,7 +23,7 @@ #include "config.h" -#define always_inline inline +#define always_inline inline #include "ffmpeg_bswap.h" @@ -98,7 +98,7 @@ ( (uint32_t)(unsigned char)(ch1) << 8 ) | \ ( (uint32_t)(unsigned char)(ch2) << 16 ) | \ ( (uint32_t)(unsigned char)(ch3) << 24 ) ) - + #ifdef WORDS_BIGENDIAN #define ME_FOURCC BE_FOURCC #else diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -1,13 +1,13 @@ /* * Copyright (C) 2000-2004 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -70,7 +70,7 @@ fprintf(stderr, _("xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n")); _x_abort(); } - + pthread_cond_signal (&this->buffer_pool_cond_not_empty); pthread_mutex_unlock (&this->buffer_pool_mutex); @@ -110,7 +110,7 @@ memset(buf->decoder_info, 0, sizeof(buf->decoder_info)); memset(buf->decoder_info_ptr, 0, sizeof(buf->decoder_info_ptr)); _x_extra_info_reset( buf->extra_info ); - + return buf; } @@ -157,7 +157,7 @@ */ static void fifo_buffer_put (fifo_buffer_t *fifo, buf_element_t *element) { int i; - + pthread_mutex_lock (&fifo->mutex); for(i = 0; fifo->put_cb[i]; i++) @@ -183,7 +183,7 @@ */ static void dummy_fifo_buffer_put (fifo_buffer_t *fifo, buf_element_t *element) { int i; - + pthread_mutex_lock (&fifo->mutex); for(i = 0; fifo->put_cb[i]; i++) @@ -450,7 +450,7 @@ this->alloc_cb_data[j] = this->alloc_cb_data[j+1]; } } - } + } pthread_mutex_unlock(&this->mutex); } @@ -471,7 +471,7 @@ this->put_cb_data[j] = this->put_cb_data[j+1]; } } - } + } pthread_mutex_unlock(&this->mutex); } @@ -492,7 +492,7 @@ this->get_cb_data[j] = this->get_cb_data[j+1]; } } - } + } pthread_mutex_unlock(&this->mutex); } diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2008 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -20,7 +20,7 @@ * * contents: * - * buffer types management. + * buffer types management. * convert FOURCC and audioformattag to BUF_xxx defines */ @@ -272,7 +272,7 @@ "Raw RGB" }, { - { + { /* is this right? copied from demux_qt: else if (!strncasecmp (video, "yuv2", 4)) this->video_type = BUF_VIDEO_YUY2; @@ -887,7 +887,7 @@ }, { { - 0x02, + 0x02, ME_FOURCC('m', 's', 0, 0x02), 0 }, @@ -911,7 +911,7 @@ "MS GSM" }, { - { + { /* these formattags are used by Vorbis ACM encoder and supported by NanDub, a variant of VirtualDub. */ 0x674f, 0x676f, 0x6750, 0x6770, 0x6751, 0x6771, @@ -1020,7 +1020,7 @@ ME_FOURCC('M', 'P', '4', 'A'), ME_FOURCC('r', 'a', 'a', 'c'), ME_FOURCC('r', 'a', 'c', 'p'), - ME_FOURCC('A', 'A', 'C', ' '), + ME_FOURCC('A', 'A', 'C', ' '), 0 }, BUF_AUDIO_AAC, @@ -1189,7 +1189,7 @@ if( fourcc_int == cached_fourcc ) return cached_buf_type; - + for( i = 0; video_db[i].buf_type; i++ ) { for( j = 0; video_db[i].fourcc[j]; j++ ) { if( fourcc_int == video_db[i].fourcc[j] ) { @@ -1204,9 +1204,9 @@ const char * _x_buf_video_name( uint32_t buf_type ) { int i; - + buf_type &= 0xffff0000; - + for( i = 0; video_db[i].buf_type; i++ ) { if( buf_type == video_db[i].buf_type ) { return video_db[i].name; @@ -1223,7 +1223,7 @@ if( formattag == cached_formattag ) return cached_buf_type; - + for( i = 0; audio_db[i].buf_type; i++ ) { for( j = 0; audio_db[i].formattag[j]; j++ ) { if( formattag == audio_db[i].formattag[j] ) { @@ -1238,9 +1238,9 @@ const char * _x_buf_audio_name( uint32_t buf_type ) { int i; - + buf_type &= 0xffff0000; - + for( i = 0; audio_db[i].buf_type; i++ ) { if( buf_type == audio_db[i].buf_type ) { return audio_db[i].name; @@ -1291,7 +1291,7 @@ /* OBS: fourcc must be read using machine endianness * so don't play with biCompression here! */ - + bih->biSize = le2me_32(bih->biSize); bih->biWidth = le2me_32(bih->biWidth); bih->biHeight = le2me_32(bih->biHeight); @@ -1305,7 +1305,7 @@ } void _x_waveformatex_le2me( xine_waveformatex *wavex ) { - + wavex->wFormatTag = le2me_16(wavex->wFormatTag); wavex->nChannels = le2me_16(wavex->nChannels); wavex->nSamplesPerSec = le2me_32(wavex->nSamplesPerSec); diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -229,7 +229,7 @@ NULL }; int i = 0; - + while (known_section[i]) if (strcmp(sect, known_section[i++]) == 0) return i; @@ -238,7 +238,7 @@ static void config_key_split(const char *key, char **base, char **section, char **subsect, char **name) { char *parse; - + *base = strdup(key); if ((parse = strchr(*base, '.'))) { *section = *base; @@ -263,10 +263,10 @@ cfg_entry_t *cur, *prev; char *new_base, *new_section, *new_subsect, *new_name; char *cur_base, *cur_section, *cur_subsect, *cur_name; - + /* extract parts of the new key */ config_key_split(new_entry->key, &new_base, &new_section, &new_subsect, &new_name); - + /* search right position */ cur_base = NULL; for (cur = this->first, prev = NULL; cur; prev = cur, cur = cur->next) { @@ -274,7 +274,7 @@ if (cur_base) free(cur_base); config_key_split(cur->key, &cur_base, &cur_section, &cur_subsect, &cur_name); - + /* sort by section name */ if (!new_section && cur_section) break; if ( new_section && !cur_section) continue; @@ -306,14 +306,14 @@ if (cmp < 0) break; if (cmp > 0) continue; } - + break; } if (new_base) free(new_base); if (cur_base) free(cur_base); - + new_entry->next = cur; if (!cur) this->last = new_entry; @@ -334,7 +334,7 @@ entry->unknown_value = NULL; entry->str_value = NULL; entry->exp_level = exp_level; - + config_insert(this, entry); lprintf ("add entry key=%s\n", key); @@ -401,7 +401,7 @@ *prev = *entry; *entry = (*entry)->next; } - + if (*entry) { free(tmp); return; @@ -424,11 +424,11 @@ static cfg_entry_t *config_lookup_entry(config_values_t *this, const char *key) { cfg_entry_t *entry, *prev; - + pthread_mutex_lock(&this->config_lock); config_lookup_entry_int(this, key, &entry, &prev); pthread_mutex_unlock(&this->config_lock); - + return entry; } @@ -539,7 +539,7 @@ /* set string */ entry->type = XINE_CONFIG_TYPE_STRING; - + if (entry->unknown_value) entry->str_value = strdup(entry->unknown_value); else @@ -770,7 +770,7 @@ entry->num_value = config_parse_enum (entry->unknown_value, (const char **)values); else entry->num_value = def_value; - + /* fill out rest of struct */ entry->num_default = def_value; @@ -820,7 +820,7 @@ static void config_update_num (config_values_t *this, const char *key, int value) { - + cfg_entry_t *entry; entry = this->lookup_entry (this, key); @@ -849,13 +849,13 @@ xine_cfg_entry_t cb_entry; config_shallow_copy(&cb_entry, entry); - + /* it is safe to enter the callback from within a locked context * because we use a recursive mutex. */ [... 215 lines omitted ...] pos += put_string(buffer, pos, *cur_value, value_len[i]); cur_value++; @@ -1373,7 +1373,7 @@ if ((pos + sizeof(int32_t)) > buffer_size) return 0; - + value_int32 = _X_LE_32(&buffer[pos]); *value = (int)value_int32; return sizeof(int32_t); @@ -1383,15 +1383,15 @@ int len; int bytes = get_int(buffer, buffer_size, pos, &len); *value = NULL; - + if (!bytes || (len < 0) || (len > 1024*64)) return 0; - + char *str = malloc(len + 1); pos += bytes; memcpy(str, &buffer[pos], len); str[len] = 0; - + *value = str; return bytes + len; } @@ -1422,25 +1422,25 @@ char *description = NULL; char *help = NULL; char **enum_values = NULL; - + int bytes; int pos; void *output = NULL; size_t output_len; int value_count = 0; int i; - + output_len = strlen(value) * 3 / 4 + 1; output = malloc(output_len); av_base64_decode(output, value, output_len); - + pos = 0; pos += bytes = get_int(output, output_len, pos, &type); if (!bytes) goto exit; pos += bytes = get_int(output, output_len, pos, &range_min); if (!bytes) goto exit; - + pos += bytes = get_int(output, output_len, pos, &range_max); if (!bytes) goto exit; @@ -1455,7 +1455,7 @@ pos += bytes = get_string(output, output_len, pos, &key); if (!bytes) goto exit; - + pos += bytes = get_string(output, output_len, pos, &str_default); if (!bytes) goto exit; @@ -1468,7 +1468,7 @@ pos += bytes = get_int(output, output_len, pos, &value_count); if (!bytes) goto exit; if ((value_count < 0) || (value_count > 256)) goto exit; - + enum_values = calloc (value_count + 1, sizeof(void*)); for (i = 0; i < value_count; i++) { pos += bytes = get_string(output, output_len, pos, &enum_values[i]); @@ -1476,7 +1476,7 @@ } enum_values[value_count] = NULL; -#ifdef LOG +#ifdef LOG printf("config entry deserialization:\n"); printf(" key : %s\n", key); printf(" type : %d\n", type); @@ -1489,7 +1489,7 @@ printf(" description: %s\n", description); printf(" help : %s\n", help); printf(" enum : %d values\n", value_count); - + for (i = 0; i < value_count; i++) { printf(" enum[%2d]: %s\n", i, enum_values[i]); } @@ -1625,13 +1625,13 @@ free(key); return -1; } - + switch(entry->type) { case XINE_CONFIG_TYPE_STRING: config->update_string(config, key, value); handled = 1; break; - + case XINE_CONFIG_TYPE_RANGE: case XINE_CONFIG_TYPE_ENUM: case XINE_CONFIG_TYPE_NUM: @@ -1639,13 +1639,13 @@ config->update_num(config, key, (atoi(value))); handled = 1; break; - + case XINE_CONFIG_TYPE_UNKNOWN: entry->unknown_value = strdup(value); handled = 1; break; } - + free(key); return handled; } diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -50,7 +50,7 @@ #include <winsock.h> #endif -/* +/* * Flush audio and video buffers. It is called from demuxers on * seek/stop, and may be useful when user input changes a stream and * xine-lib has cached buffers that have yet to be played. @@ -62,10 +62,10 @@ void _x_demux_flush_engine (xine_stream_t *stream) { buf_element_t *buf; - + if( stream->gapless_switch ) return; - + stream->xine->port_ticket->acquire(stream->xine->port_ticket, 1); /* only flush/discard output ports on master streams */ @@ -77,23 +77,23 @@ stream->audio_out->set_property(stream->audio_out, AO_PROP_DISCARD_BUFFERS, 1); } } - + stream->video_fifo->clear(stream->video_fifo); stream->audio_fifo->clear(stream->audio_fifo); - - pthread_mutex_lock(&stream->demux_mutex); + + pthread_mutex_lock(&stream->demux_mutex); buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); buf->type = BUF_CONTROL_RESET_DECODER; stream->video_fifo->put (stream->video_fifo, buf); - + buf = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo); buf->type = BUF_CONTROL_RESET_DECODER; stream->audio_fifo->put (stream->audio_fifo, buf); - - pthread_mutex_unlock(&stream->demux_mutex); - /* on seeking we must wait decoder fifos to process before doing flush. + pthread_mutex_unlock(&stream->demux_mutex); + + /* on seeking we must wait decoder fifos to process before doing flush. * otherwise we flush too early (before the old data has left decoders) */ _x_demux_control_headers_done (stream); @@ -102,7 +102,7 @@ video_overlay_manager_t *ovl = stream->video_out->get_overlay_manager(stream->video_out); ovl->flush_events(ovl); } - + /* only flush/discard output ports on master streams */ if( stream->master == stream ) { if (stream->video_out) { @@ -115,7 +115,7 @@ stream->audio_out->set_property(stream->audio_out, AO_PROP_DISCARD_BUFFERS, 0); } } - + stream->xine->port_ticket->release(stream->xine->port_ticket, 1); } @@ -151,8 +151,8 @@ void _x_demux_control_newpts( xine_stream_t *stream, int64_t pts, uint32_t flags ) { buf_element_t *buf; - - pthread_mutex_lock(&stream->demux_mutex); + + pthread_mutex_lock(&stream->demux_mutex); buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); buf->type = BUF_CONTROL_NEWPTS; @@ -166,7 +166,7 @@ buf->disc_off = pts; stream->audio_fifo->put (stream->audio_fifo, buf); - pthread_mutex_unlock(&stream->demux_mutex); + pthread_mutex_unlock(&stream->demux_mutex); } /* avoid ao_loop being stuck in a pthread_cond_wait, waiting for data; @@ -201,7 +201,7 @@ /* we use demux_action_pending to wake up sleeping spu decoders */ stream->demux_action_pending = 1; - + /* allocate the buffers before grabbing the lock to prevent cyclic wait situations */ buf_video = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); buf_audio = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo); @@ -219,8 +219,8 @@ } else { header_count_audio = 0; } - - pthread_mutex_lock(&stream->demux_mutex); + + pthread_mutex_lock(&stream->demux_mutex); buf_video->type = BUF_CONTROL_HEADERS_DONE; stream->video_fifo->put (stream->video_fifo, buf_video); @@ -228,24 +228,24 @@ buf_audio->type = BUF_CONTROL_HEADERS_DONE; stream->audio_fifo->put (stream->audio_fifo, buf_audio); - pthread_mutex_unlock(&stream->demux_mutex); + pthread_mutex_unlock(&stream->demux_mutex); unsigned int max_iterations = 0; - while ((stream->header_count_audio < header_count_audio) || + while ((stream->header_count_audio < header_count_audio) || (stream->header_count_video < header_count_video)) { lprintf ("waiting for headers. v:%d %d a:%d %d\n", stream->header_count_video, header_count_video, [... 106 lines omitted ...] + _x_demux_control_end(stream, non_user); lprintf ("loop finished, end buffer sent\n"); @@ -409,7 +409,7 @@ struct timespec ts; unsigned int max_iterations = 0; int ret_wait; - while ((stream->finished_count_audio < finished_count_audio) || + while ((stream->finished_count_audio < finished_count_audio) || (stream->finished_count_video < finished_count_video)) { lprintf ("waiting for finisheds.\n"); ts = _x_compute_interval(1000); @@ -423,7 +423,7 @@ } } pthread_mutex_unlock (&stream->counter_lock); - + _x_handle_stream_end(stream, non_user); return NULL; } @@ -431,14 +431,14 @@ int _x_demux_start_thread (xine_stream_t *stream) { int err; - + lprintf ("start thread called\n"); - + stream->demux_action_pending = 1; pthread_mutex_lock( &stream->demux_lock ); stream->demux_action_pending = 0; pthread_cond_signal(&stream->demux_resume); - + if( !stream->demux_thread_running ) { if (stream->demux_thread_created) { @@ -454,17 +454,17 @@ _x_abort(); } } - + pthread_mutex_unlock( &stream->demux_lock ); return 0; } int _x_demux_stop_thread (xine_stream_t *stream) { - + void *p; - + lprintf ("stop thread called\n"); - + stream->demux_action_pending = 1; pthread_mutex_lock( &stream->demux_lock ); stream->demux_thread_running = 0; @@ -478,12 +478,12 @@ pthread_mutex_unlock( &stream->demux_lock ); lprintf ("joining thread %ld\n", stream->demux_thread ); - + if( stream->demux_thread_created ) { pthread_join (stream->demux_thread, &p); stream->demux_thread_created = 0; } - + /* * Wake up xine_play if it's waiting for a frame */ @@ -634,7 +634,7 @@ * * the other ones help enforcing that demuxers provide the information * they have about the stream, so things like the GUI slider bar can - * work as expected. + * work as expected. */ void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, int64_t pts, uint32_t type, uint32_t decoder_flags, @@ -682,10 +682,10 @@ * * If reading fails, -1 is returned */ -int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, - int size, int64_t pts, uint32_t type, - uint32_t decoder_flags, off_t input_normpos, - int input_time, int total_time, +int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, + int size, int64_t pts, uint32_t type, + uint32_t decoder_flags, off_t input_normpos, + int input_time, int total_time, uint32_t frame_number) { buf_element_t *buf; @@ -707,7 +707,7 @@ if(input->read(input, buf->content, buf->size) < buf->size) { buf->free_buffer(buf); - return -1; + return -1; } size -= buf->size; @@ -723,7 +723,7 @@ fifo->put (fifo, buf); } - + return 0; } @@ -750,7 +750,7 @@ event.data_length = offsetof (xine_mrl_reference_data_ext_t, mrl) + mrl_len + strlen (title) + 2; data.e = event.data = malloc (event.data_length); - + data.e->alternative = alternative; data.e->start_time = start_time; data.e->duration = duration; diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c --- a/src/xine-engine/events.c +++ b/src/xine-engine/events.c @@ -1,18 +1,18 @@ -/* +/* * Copyright (C) 2000-2004 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -94,7 +94,7 @@ cevent->data = NULL; } gettimeofday (&cevent->tv, NULL); - + pthread_mutex_lock (&queue->lock); xine_list_push_back (queue->events, cevent); pthread_cond_signal (&queue->new_event); @@ -135,7 +135,7 @@ xine_event_t *qevent; xine_event_queue_t *q; xine_list_iterator_t ite; - + pthread_mutex_lock (&stream->event_queues_lock); ite = xine_list_front (stream->event_queues); @@ -144,7 +144,7 @@ if ( ite ) { do { q = xine_list_get_value (stream->event_queues, ite); - + if ( q == queue ) break; } while( (ite = xine_list_next (stream->event_queues, ite)) ); @@ -160,17 +160,17 @@ xine_list_remove (stream->event_queues, ite); pthread_mutex_unlock (&stream->event_queues_lock); - /* - * send quit event + /* + * send quit event */ qevent = (xine_event_t *)malloc(sizeof(xine_event_t)); - + qevent->type = XINE_EVENT_QUIT; qevent->stream = stream; qevent->data = NULL; qevent->data_length = 0; gettimeofday (&qevent->tv, NULL); - + pthread_mutex_lock (&queue->lock); xine_list_push_back (queue->events, qevent); pthread_cond_signal (&queue->new_event); @@ -179,15 +179,15 @@ /* * join listener thread, if any */ - + if (queue->listener_thread) { void *p; pthread_join (*queue->listener_thread, &p); free (queue->listener_thread); } - + /* - * clean up pending events + * clean up pending events */ while ( (event = xine_event_get (queue)) ) { @@ -233,7 +233,7 @@ } -void xine_event_create_listener_thread (xine_event_queue_t *queue, +void xine_event_create_listener_thread (xine_event_queue_t *queue, xine_event_listener_cb_t callback, void *user_data) { int err; diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c --- a/src/xine-engine/info_helper.c +++ b/src/xine-engine/info_helper.c @@ -40,7 +40,7 @@ /* ******************* Stream Info *************************** */ /* - * Compare stream_info, private and public values, + * Compare stream_info, private and public values, * return 1 if it's identical, otherwirse 0. */ static int stream_info_is_identical(xine_stream_t *stream, int info) { @@ -105,7 +105,7 @@ pthread_mutex_lock(&stream->info_mutex); stream_info = stream->stream_info[info]; pthread_mutex_unlock(&stream->info_mutex); - + return stream_info; } @@ -120,7 +120,7 @@ if(info_valid(info) && (!stream_info_is_identical(stream, info))) stream_info = stream->stream_info_public[info] = stream->stream_info[info]; pthread_mutex_unlock(&stream->info_mutex); - + ... [truncated message content] |