From 5ca0ebcca2e3f55a1087811048684a3b9b1eecbf Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 22 Dec 2003 14:32:57 +0000 Subject: [PATCH] * Coding style cleanup: removed tabs and trailing spaces. --- modules/access/cdda/access.c | 328 +++++------ modules/access/cdda/cdda.h | 12 +- modules/access/dvb/qpsk.c | 4 +- modules/access/dvd/access.c | 12 +- modules/access/v4l/videodev_mjpeg.h | 16 +- modules/access/vcdx/access.c | 518 +++++++++--------- modules/access/vcdx/intf.c | 266 ++++----- modules/access/vcdx/intf.h | 14 +- modules/audio_filter/resampler/linear.c | 42 +- modules/audio_output/oss.c | 8 +- modules/audio_output/sdl.c | 6 +- modules/codec/a52.c | 4 +- modules/codec/dts.c | 6 +- modules/codec/libmpeg2.c | 30 +- modules/codec/ogt/ogt.h | 78 +-- modules/control/lirc/lirc.c | 32 +- modules/control/rc/rc.c | 12 +- modules/demux/mp4/libmp4.c | 11 +- modules/demux/mpeg/ps.c | 14 +- modules/demux/mpeg/system.c | 16 +- modules/demux/ogg.c | 8 +- modules/gui/gtk/gtk_callbacks.c | 22 +- modules/gui/gtk/menu.c | 28 +- modules/gui/gtk/open.c | 108 ++-- modules/gui/gtk/playlist.c | 4 +- modules/gui/macosx/intf.h | 20 +- modules/gui/macosx/prefs.m | 6 +- modules/gui/ncurses/ncurses.c | 20 +- modules/gui/pda/pda.c | 10 +- modules/gui/skins/x11/x11_api.cpp | 18 +- modules/misc/memcpy/memcpyaltivec.c | 8 +- modules/stream_out/duplicate.c | 6 +- modules/stream_out/transrate/getvlc.h | 8 +- modules/video_chroma/i420_rgb.c | 12 +- .../video_filter/deinterlace/deinterlace.c | 8 +- modules/video_output/qte/qte.cpp | 28 +- modules/video_output/x11/xcommon.c | 18 +- modules/visualization/visual/fft.c | 104 ++-- src/input/demux.c | 8 +- src/input/input_ext-intf.c | 6 +- src/input/subtitles.c | 190 +++---- src/interface/intf_eject.c | 28 +- src/misc/charset.c | 155 +++--- src/misc/darwin_specific.m | 20 +- src/video_output/video_text.c | 36 +- 45 files changed, 1152 insertions(+), 1156 deletions(-) diff --git a/modules/access/cdda/access.c b/modules/access/cdda/access.c index 471a7bd74c..e6fd0a2bb0 100644 --- a/modules/access/cdda/access.c +++ b/modules/access/cdda/access.c @@ -2,9 +2,9 @@ * cddax.c : CD digital audio input module for vlc using libcdio ***************************************************************************** * Copyright (C) 2000,2003 VideoLAN - * $Id: access.c,v 1.17 2003/12/16 22:14:22 gbazin Exp $ + * $Id: access.c,v 1.18 2003/12/22 14:32:55 sam Exp $ * - * Authors: Rocky Bernstein + * Authors: Rocky Bernstein * Laurent Aimar * Gildas Bazin * @@ -68,9 +68,9 @@ static void CDDASeek ( input_thread_t *, off_t ); static int CDDASetArea ( input_thread_t *, input_area_t * ); static int CDDASetProgram ( input_thread_t *, pgrm_descriptor_t * ); -static int CDDAFixupPlayList( input_thread_t *p_input, - cdda_data_t *p_cdda, const char *psz_source, - bool play_single_track); +static int CDDAFixupPlayList( input_thread_t *p_input, + cdda_data_t *p_cdda, const char *psz_source, + bool play_single_track); /**************************************************************************** * Private functions @@ -84,7 +84,7 @@ cdio_log_handler (cdio_log_level_t level, const char message[]) switch (level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: - if (p_cdda->i_debug & INPUT_DBG_CDIO) + if (p_cdda->i_debug & INPUT_DBG_CDIO) msg_Dbg( p_cdda_input, message); break; case CDIO_LOG_WARN: @@ -96,7 +96,7 @@ cdio_log_handler (cdio_log_level_t level, const char message[]) break; default: msg_Warn( p_cdda_input, message, - _("The above message had unknown vcdimager log level"), + _("The above message had unknown vcdimager log level"), level); } return; @@ -104,10 +104,10 @@ cdio_log_handler (cdio_log_level_t level, const char message[]) #ifdef HAVE_LIBCDDB -/*! This routine is called by libcddb routines on error. +/*! This routine is called by libcddb routines on error. Setup is done by init_input_plugin. */ -static void +static void cddb_log_handler (cddb_log_level_t level, const char message[]) { cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_access_data; @@ -124,9 +124,9 @@ cddb_log_handler (cddb_log_level_t level, const char message[]) /*! This routine is when xine is not fully set up (before full initialization) - or is not around (before finalization). + or is not around (before finalization). */ -static void +static void uninit_log_handler (cdio_log_level_t level, const char message[]) { cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_access_data; @@ -147,11 +147,11 @@ uninit_log_handler (cdio_log_level_t level, const char message[]) break; default: fprintf(stderr, "UNKNOWN ERROR: %s\n%s %d\n", - message, - _("The above message had unknown cdio log level"), + message, + _("The above message had unknown cdio log level"), level); } - + /* gl_default_cdio_log_handler (level, message); */ } @@ -196,7 +196,7 @@ static int CDDARead( input_thread_t * p_input, byte_t * p_buffer, for ( i_index = 0; i_index < i_blocks; i_index++ ) { - if (cdio_read_audio_sector(p_cdda->p_cddev->cdio, p_buffer, + if (cdio_read_audio_sector(p_cdda->p_cddev->cdio, p_buffer, p_cdda->i_sector) != 0) { msg_Err( p_input, "could not read sector %d", p_cdda->i_sector ); @@ -208,8 +208,8 @@ static int CDDARead( input_thread_t * p_input, byte_t * p_buffer, { input_area_t *p_area; - dbg_print( (INPUT_DBG_LSN|INPUT_DBG_CALL), - "end of track, cur: %u", p_cdda->i_sector ); + dbg_print( (INPUT_DBG_LSN|INPUT_DBG_CALL), + "end of track, cur: %u", p_cdda->i_sector ); /*???? if ( p_cdda->i_track >= p_cdda->i_nb_tracks - 1 )*/ return 0; /* EOF */ @@ -305,15 +305,15 @@ static void CDDASeek( input_thread_t * p_input, off_t i_off ) vlc_mutex_unlock( &p_input->stream.stream_lock ); dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_SEEK), - "sector %ud, offset: %lld, i_tell: %lld", p_cdda->i_sector, i_off, + "sector %ud, offset: %lld, i_tell: %lld", p_cdda->i_sector, i_off, p_input->stream.p_selected_area->i_tell ); } -#define meta_info_add_str(title, str) \ - if ( str ) { \ - dbg_print( INPUT_DBG_META, "field %s: %s\n", title, str); \ - input_AddInfo( p_cat, _(title), "%s", str ); \ +#define meta_info_add_str(title, str) \ + if ( str ) { \ + dbg_print( INPUT_DBG_META, "field %s: %s\n", title, str); \ + input_AddInfo( p_cat, _(title), "%s", str ); \ } @@ -321,12 +321,12 @@ static void InformationCreate( input_thread_t *p_input ) { cdda_data_t *p_cdda = (cdda_data_t *) p_input->p_access_data; input_info_category_t *p_cat; - + p_cat = input_InfoCategory( p_input, "General" ); #ifdef HAVE_LIBCDDB if (p_cdda->i_cddb_enabled) { - + meta_info_add_str( "Title", p_cdda->cddb.disc->title ); meta_info_add_str( "Artist", p_cdda->cddb.disc->artist ); meta_info_add_str( "Genre", p_cdda->cddb.disc->genre ); @@ -334,19 +334,19 @@ static void InformationCreate( input_thread_t *p_input ) { char year[5]; if (p_cdda->cddb.disc->year != 0) { - snprintf(year, 5, "%d", p_cdda->cddb.disc->year); - meta_info_add_str( "Year", year ); + snprintf(year, 5, "%d", p_cdda->cddb.disc->year); + meta_info_add_str( "Year", year ); } if ( p_cdda->cddb.disc->discid ) { - input_AddInfo( p_cat, _("CDDB Disc ID"), "%x", - p_cdda->cddb.disc->discid ); + input_AddInfo( p_cat, _("CDDB Disc ID"), "%x", + p_cdda->cddb.disc->discid ); } - + if ( p_cdda->cddb.disc->category != CDDB_CAT_INVALID ) { - input_AddInfo( p_cat, _("CDDB Disc Category"), "%s", - CDDB_CATEGORY[p_cdda->cddb.disc->category] ); + input_AddInfo( p_cat, _("CDDB Disc Category"), "%s", + CDDB_CATEGORY[p_cdda->cddb.disc->category] ); } - + } } @@ -355,13 +355,13 @@ static void InformationCreate( input_thread_t *p_input ) { track_t i_track = p_cdda->i_nb_tracks; char psz_buffer[MSTRTIME_MAX_SIZE]; - mtime_t i_duration = - (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[0]) + mtime_t i_duration = + (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[0]) / CDIO_CD_FRAMES_PER_SEC; dbg_print( INPUT_DBG_META, "Duration %ld", (long int) i_duration ); - input_AddInfo( p_cat, _("Duration"), "%s", - secstotimestr( psz_buffer, i_duration ) ); + input_AddInfo( p_cat, _("Duration"), "%s", + secstotimestr( psz_buffer, i_duration ) ); } } @@ -369,9 +369,9 @@ static void InformationCreate( input_thread_t *p_input ) #ifdef HAVE_LIBCDDB #define free_and_dup(var, val) \ - if (var) free(var); \ - if (val) var=strdup(val); - + if (var) free(var); \ + if (val) var=strdup(val); + static void GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) @@ -383,46 +383,46 @@ GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) int i, i_matches; cddb_conn_t *conn = cddb_new(); const CdIo *cdio = p_cdda->p_cddev->cdio; - - + + cddb_log_set_handler (uninit_log_handler); if (!conn) { msg_Warn( p_input, "unable to initialize libcddb" ); goto cddb_destroy; } - - cddb_set_email_address( conn, - config_GetPsz( p_input, - MODULE_STRING "-cddb-email") ); - - cddb_set_server_name( conn, - config_GetPsz( p_input, - MODULE_STRING "-cddb-server") ); - - cddb_set_server_port(conn, - config_GetInt( p_input, - MODULE_STRING "-cddb-port") ); + + cddb_set_email_address( conn, + config_GetPsz( p_input, + MODULE_STRING "-cddb-email") ); + + cddb_set_server_name( conn, + config_GetPsz( p_input, + MODULE_STRING "-cddb-server") ); + + cddb_set_server_port(conn, + config_GetInt( p_input, + MODULE_STRING "-cddb-port") ); /* Set the location of the local CDDB cache directory. The default location of this directory is */ - if (!config_GetInt( p_input, MODULE_STRING "-cddb-enable-cache" )) + if (!config_GetInt( p_input, MODULE_STRING "-cddb-enable-cache" )) cddb_cache_disable(conn); - cddb_cache_set_dir(conn, - config_GetPsz( p_input, - MODULE_STRING "-cddb-cachedir") ); + cddb_cache_set_dir(conn, + config_GetPsz( p_input, + MODULE_STRING "-cddb-cachedir") ); - cddb_set_timeout(conn, - config_GetInt( p_input, MODULE_STRING "-cddb-timeout") ); + cddb_set_timeout(conn, + config_GetInt( p_input, MODULE_STRING "-cddb-timeout") ); if (config_GetInt( p_input, MODULE_STRING "-cddb-httpd" )) { cddb_http_enable(conn); } else cddb_http_disable(conn); - + p_cdda->cddb.disc = cddb_disc_new(); if (!p_cdda->cddb.disc) { msg_Err( p_input, "Unable to create CDDB disc structure." ); @@ -430,13 +430,13 @@ GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) } for(i = 1; i <= p_cdda->i_nb_tracks; i++) { - cddb_track_t *t = cddb_track_new(); + cddb_track_t *t = cddb_track_new(); t->frame_offset = cdio_get_track_lba(cdio, i); cddb_disc_add_track(p_cdda->cddb.disc, t); } - - p_cdda->cddb.disc->length = - cdio_get_track_lba(cdio, CDIO_CDROM_LEADOUT_TRACK) + + p_cdda->cddb.disc->length = + cdio_get_track_lba(cdio, CDIO_CDROM_LEADOUT_TRACK) / CDIO_CD_FRAMES_PER_SEC; @@ -448,12 +448,12 @@ GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) i_matches = cddb_query(conn, p_cdda->cddb.disc); if (i_matches > 0) { if (i_matches > 1) - msg_Warn( p_input, "Found %d matches in CDDB. Using first one.", - i_matches); + msg_Warn( p_input, "Found %d matches in CDDB. Using first one.", + i_matches); cddb_read(conn, p_cdda->cddb.disc); - if (p_cdda->i_debug & INPUT_DBG_CDDB) - cddb_disc_print(p_cdda->cddb.disc); + if (p_cdda->i_debug & INPUT_DBG_CDDB) + cddb_disc_print(p_cdda->cddb.disc); } else { msg_Warn( p_input, "CDDB error: %s", cddb_error_str(errno)); @@ -466,36 +466,36 @@ GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) } #endif /*HAVE_LIBCDDB*/ -#define add_format_str_info(val) \ - { \ - const char *str = val; \ - unsigned int len; \ - if (val != NULL) { \ - len=strlen(str); \ - if (len != 0) { \ - strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \ - tp += len; \ - } \ - saw_control_prefix = false; \ - } \ +#define add_format_str_info(val) \ + { \ + const char *str = val; \ + unsigned int len; \ + if (val != NULL) { \ + len=strlen(str); \ + if (len != 0) { \ + strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \ + tp += len; \ + } \ + saw_control_prefix = false; \ + } \ } -#define add_format_num_info(val, fmt) \ - { \ - char num_str[10]; \ - unsigned int len; \ - sprintf(num_str, fmt, val); \ - len=strlen(num_str); \ - if (len != 0) { \ - strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \ - tp += len; \ - } \ - saw_control_prefix = false; \ +#define add_format_num_info(val, fmt) \ + { \ + char num_str[10]; \ + unsigned int len; \ + sprintf(num_str, fmt, val); \ + len=strlen(num_str); \ + if (len != 0) { \ + strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \ + tp += len; \ + } \ + saw_control_prefix = false; \ } /*! Take a format string and expand escape sequences, that is sequences that - begin with %, with information from the current CD. + begin with %, with information from the current CD. The expanded string is returned. Here is a list of escape sequences: %a : The album artist ** @@ -515,7 +515,7 @@ GetCDDBInfo( const input_thread_t *p_input, cdda_data_t *p_cdda ) */ static char * CDDAFormatStr(const input_thread_t *p_input, cdda_data_t *p_cdda, - const char format_str[], const char *mrl, int i_track) + const char format_str[], const char *mrl, int i_track) { #define TEMP_STR_SIZE 256 #define TEMP_STR_LEN (TEMP_STR_SIZE-1) @@ -538,11 +538,11 @@ CDDAFormatStr(const input_thread_t *p_input, cdda_data_t *p_cdda, switch(format_str[i]) { case '%': if (saw_control_prefix) { - *tp++ = '%'; + *tp++ = '%'; } saw_control_prefix = !saw_control_prefix; break; -#ifdef HAVE_LIBCDDB +#ifdef HAVE_LIBCDDB case 'a': if (!p_cdda->i_cddb_enabled) goto not_special; add_format_str_info(p_cdda->cddb.disc->artist); @@ -569,18 +569,18 @@ CDDAFormatStr(const input_thread_t *p_input, cdda_data_t *p_cdda, break; case 't': if (p_cdda->i_cddb_enabled) { - cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, - i_track-1); - if (t != NULL && t->title != NULL) - add_format_str_info(t->title); + cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, + i_track-1); + if (t != NULL && t->title != NULL) + add_format_str_info(t->title); } else goto not_special; break; case 'p': if (p_cdda->i_cddb_enabled) { - cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, - i_track-1); - if (t != NULL && t->artist != NULL) - add_format_str_info(t->artist); + cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, + i_track-1); + if (t != NULL && t->artist != NULL) + add_format_str_info(t->artist); } else goto not_special; break; #endif @@ -601,22 +601,22 @@ CDDAFormatStr(const input_thread_t *p_input, cdda_data_t *p_cdda, case 's': if (p_cdda->i_cddb_enabled) { - char psz_buffer[MSTRTIME_MAX_SIZE]; - mtime_t i_duration = - (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) - / CDIO_CD_FRAMES_PER_SEC; - add_format_str_info(secstotimestr( psz_buffer, i_duration ) ); + char psz_buffer[MSTRTIME_MAX_SIZE]; + mtime_t i_duration = + (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) + / CDIO_CD_FRAMES_PER_SEC; + add_format_str_info(secstotimestr( psz_buffer, i_duration ) ); } else goto not_special; break; case 'T': add_format_num_info(i_track, "%02d"); break; -#ifdef HAVE_LIBCDDB +#ifdef HAVE_LIBCDDB not_special: #endif default: - *tp++ = '%'; + *tp++ = '%'; *tp++ = format_str[i]; saw_control_prefix = false; } @@ -625,14 +625,14 @@ CDDAFormatStr(const input_thread_t *p_input, cdda_data_t *p_cdda, } static void -CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, - playlist_t *p_playlist, unsigned int i_track, - char *psz_mrl, int psz_mrl_max, - const char *psz_source, int playlist_operation, - int i_pos) +CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, + playlist_t *p_playlist, unsigned int i_track, + char *psz_mrl, int psz_mrl_max, + const char *psz_source, int playlist_operation, + int i_pos) { - mtime_t i_duration = - (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) + mtime_t i_duration = + (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) / CDIO_CD_FRAMES_PER_SEC; char *p_author; char *p_title; @@ -644,23 +644,23 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, } #endif - snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u", - CDDA_MRL_PREFIX, psz_source, i_track); + snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u", + CDDA_MRL_PREFIX, psz_source, i_track); p_title = CDDAFormatStr(p_input, p_cdda, - config_GetPsz( p_input, config_varname ), - psz_mrl, i_track); + config_GetPsz( p_input, config_varname ), + psz_mrl, i_track); dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d", - psz_mrl, p_title, (long int) i_duration, i_pos ); + psz_mrl, p_title, (long int) i_duration, i_pos ); - playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000, - 0, 0, playlist_operation, i_pos ); + playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000, + 0, 0, playlist_operation, i_pos ); - p_author = + p_author = CDDAFormatStr( p_input, p_cdda, - config_GetPsz( p_input, MODULE_STRING "-author-format" ), - psz_mrl, i_track ); + config_GetPsz( p_input, MODULE_STRING "-author-format" ), + psz_mrl, i_track ); /* FIXME: This is horrible, but until the playlist interface is fixed up something like this has to be done for the "Author" field. @@ -672,20 +672,20 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, } static int -CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda, - const char *psz_source, bool play_single_track) +CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda, + const char *psz_source, bool play_single_track) { int i; playlist_t * p_playlist; char * psz_mrl; - unsigned int psz_mrl_max = strlen(CDDA_MRL_PREFIX) + strlen(psz_source) + + unsigned int psz_mrl_max = strlen(CDDA_MRL_PREFIX) + strlen(psz_source) + strlen("@T") + strlen("100") + 1; #ifdef HAVE_LIBCDDB - p_cdda->i_cddb_enabled = + p_cdda->i_cddb_enabled = config_GetInt( p_input, MODULE_STRING "-cddb-enabled" ); #endif - + if (play_single_track && !p_cdda->i_cddb_enabled) return 0; psz_mrl = malloc( psz_mrl_max ); @@ -697,7 +697,7 @@ CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda, } p_playlist = (playlist_t *) vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, - FIND_ANYWHERE ); + FIND_ANYWHERE ); if( !p_playlist ) { msg_Warn( p_input, "can't find playlist" ); @@ -708,35 +708,35 @@ CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda, #ifdef HAVE_LIBCDDB if (p_cdda->i_cddb_enabled) GetCDDBInfo(p_input, p_cdda); - else + else p_cdda->cddb.disc = NULL; #endif InformationCreate(p_input); - + if (play_single_track) { /* May fill out more information when the playlist user interface becomes more mature. */ - CDDACreatePlayListItem(p_input, p_cdda, p_playlist, p_cdda->i_track+1, - psz_mrl, psz_mrl_max, psz_source, PLAYLIST_REPLACE, - p_playlist->i_index); + CDDACreatePlayListItem(p_input, p_cdda, p_playlist, p_cdda->i_track+1, + psz_mrl, psz_mrl_max, psz_source, PLAYLIST_REPLACE, + p_playlist->i_index); } else { - + playlist_Delete( p_playlist, p_playlist->i_index); for( i = 1 ; i <= p_cdda->i_nb_tracks ; i++ ) { - CDDACreatePlayListItem(p_input, p_cdda, p_playlist, i, psz_mrl, - psz_mrl_max, psz_source, PLAYLIST_APPEND, - PLAYLIST_END); + CDDACreatePlayListItem(p_input, p_cdda, p_playlist, i, psz_mrl, + psz_mrl_max, psz_source, PLAYLIST_APPEND, + PLAYLIST_END); } playlist_Command( p_playlist, PLAYLIST_GOTO, 0 ); } - + vlc_object_release( p_playlist ); free(psz_mrl); return 0; @@ -747,16 +747,16 @@ CDDAFixupPlayList( input_thread_t *p_input, cdda_data_t *p_cdda, ****************************************************************************/ int E_(DebugCB) ( vlc_object_t *p_this, const char *psz_name, - vlc_value_t oldval, vlc_value_t val, void *p_data ) + vlc_value_t oldval, vlc_value_t val, void *p_data ) { cdda_data_t *p_cdda; if (NULL == p_cdda_input) return VLC_EGENERIC; - + p_cdda = (cdda_data_t *)p_cdda_input->p_access_data; if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { - msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d", + msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d", p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int); } p_cdda->i_debug = val.i_int; @@ -765,18 +765,18 @@ E_(DebugCB) ( vlc_object_t *p_this, const char *psz_name, int E_(CDDBEnabledCB) ( vlc_object_t *p_this, const char *psz_name, - vlc_value_t oldval, vlc_value_t val, void *p_data ) + vlc_value_t oldval, vlc_value_t val, void *p_data ) { cdda_data_t *p_cdda; if (NULL == p_cdda_input) return VLC_EGENERIC; - + p_cdda = (cdda_data_t *)p_cdda_input->p_access_data; if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { - msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d", - p_cdda->i_cddb_enabled, p_cdda->i_cddb_enabled, - val.i_int, val.i_int); + msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d", + p_cdda->i_cddb_enabled, p_cdda->i_cddb_enabled, + val.i_int, val.i_int); } p_cdda->i_cddb_enabled = val.i_int; return VLC_SUCCESS; @@ -786,16 +786,16 @@ E_(CDDBEnabledCB) ( vlc_object_t *p_this, const char *psz_name, #if PLAYLIST_INTERFACE_IS_FIXED int E_(TitleFormatCB) ( vlc_object_t *p_this, const char *psz_name, - vlc_value_t oldval, vlc_value_t val, void *p_data ) + vlc_value_t oldval, vlc_value_t val, void *p_data ) { cdda_data_t *p_cdda; if (NULL == p_cdda_input) return VLC_EGENERIC; - + p_cdda = (cdda_data_t *)p_cdda_input->p_access_data; if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { - msg_Dbg( p_cdda_input, "Old CDDB Enabled (%s), new (%s)", + msg_Dbg( p_cdda_input, "Old CDDB Enabled (%s), new (%s)", oldval.psz_string, val.psz_string); } ???? @@ -806,7 +806,7 @@ E_(TitleFormatCB) ( vlc_object_t *p_this, const char *psz_name, /***************************************************************************** * Open: open cdda *****************************************************************************/ -int +int E_(Open)( vlc_object_t *p_this ) { input_thread_t * p_input = (input_thread_t *)p_this; @@ -841,12 +841,12 @@ E_(Open)( vlc_object_t *p_this ) *psz_parser = '\0'; ++psz_parser; - if ('T' == *psz_parser || 't' == *psz_parser ) + if ('T' == *psz_parser || 't' == *psz_parser ) ++psz_parser; - + i_track = (int)strtol( psz_parser, NULL, 10 ); i_track = i_track ? i_track : 1; - play_single_track = true; + play_single_track = true; } if( !*psz_source ) { @@ -856,10 +856,10 @@ E_(Open)( vlc_object_t *p_this ) return -1; } psz_source = config_GetPsz( p_input, "cd-audio" ); - + if( !psz_source || 0==strlen(psz_source) ) { /* Scan for a CD-ROM drive with a CD-DA in it. */ - char **cd_drives = + char **cd_drives = cdio_get_devices_with_cap(NULL, CDIO_FS_AUDIO, false); if (NULL == cd_drives) return -1; if (cd_drives[0] == NULL) { @@ -912,7 +912,7 @@ E_(Open)( vlc_object_t *p_this ) { ioctl_Close( p_cdda->p_cddev ); free( p_cdda ); - free( psz_source ); + free( psz_source ); return -1; } @@ -963,8 +963,8 @@ E_(Open)( vlc_object_t *p_this ) p_input->pf_set_program = CDDASetProgram; /* Update default_pts to a suitable value for cdda access */ - p_input->i_pts_delay = config_GetInt( p_input, - MODULE_STRING "-caching" ) * 1000; + p_input->i_pts_delay = config_GetInt( p_input, + MODULE_STRING "-caching" ) * 1000; free( psz_source ); @@ -974,7 +974,7 @@ E_(Open)( vlc_object_t *p_this ) /***************************************************************************** * CDDAClose: closes cdda *****************************************************************************/ -void +void E_(Close)( vlc_object_t *p_this ) { input_thread_t * p_input = (input_thread_t *)p_this; diff --git a/modules/access/cdda/cdda.h b/modules/access/cdda/cdda.h index 18c9f52a18..5209f65d07 100644 --- a/modules/access/cdda/cdda.h +++ b/modules/access/cdda/cdda.h @@ -3,9 +3,9 @@ * using libcdio, libvcd and libvcdinfo ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: cdda.h,v 1.3 2003/11/30 22:26:49 rocky Exp $ + * $Id: cdda.h,v 1.4 2003/12/22 14:32:55 sam Exp $ * - * Authors: Rocky Bernstein + * Author: Rocky Bernstein * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #endif /***************************************************************************** - * Debugging + * Debugging *****************************************************************************/ #define INPUT_DBG_META 1 /* Meta information */ #define INPUT_DBG_EVENT 2 /* Trace keyboard events */ @@ -47,7 +47,7 @@ if (p_cdda->i_debug & mask) \ msg_Dbg(p_input, "%s: "s, __func__ , ##args) #else -#define dbg_print(mask, s, args...) +#define dbg_print(mask, s, args...) #endif /***************************************************************************** @@ -70,8 +70,8 @@ typedef struct cdda_data_s struct { bool have_info; /* True if we have any info */ cddb_disc_t *disc; /* libcdio uses this to get disc info */ - int disc_length; /* Length in frames of cd. Used in - CDDB lookups */ + int disc_length; /* Length in frames of cd. Used in + CDDB lookups */ } cddb; #endif diff --git a/modules/access/dvb/qpsk.c b/modules/access/dvb/qpsk.c index 7dfff82234..98ece85065 100644 --- a/modules/access/dvb/qpsk.c +++ b/modules/access/dvb/qpsk.c @@ -3,7 +3,7 @@ ***************************************************************************** * Copyright (C) 2003 VideoLAN * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * Jean-Paul Saman * Christopher Ross * @@ -71,7 +71,7 @@ void E_(Close) ( vlc_object_t * ); #define LNB_SLOF_TEXT N_("antenna lnb_slof (kHz)") #define LNB_SLOF_LONGTEXT "" -#define PROBE_TEXT N_("probe the dvb card for capabilities (default disabled)") +#define PROBE_TEXT N_("probe the dvb card for capabilities (default disabled)") #define PROBE_LONGTEXT N_("some dvb cards do not like to be probed for their capabilities") /* Cable */ diff --git a/modules/access/dvd/access.c b/modules/access/dvd/access.c index 86228a19ff..69e93d6ee1 100644 --- a/modules/access/dvd/access.c +++ b/modules/access/dvd/access.c @@ -8,7 +8,7 @@ * -udf.* to find files ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: access.c,v 1.14 2003/10/25 00:49:13 sam Exp $ + * $Id: access.c,v 1.15 2003/12/22 14:32:55 sam Exp $ * * Author: Stéphane Borel * @@ -502,11 +502,11 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) val.i_int = p_area->i_id; var_Change( p_input, "title", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL ); - for( i = 1; i <= p_area->i_part_nb; i++ ) - { - val.i_int = i; - var_Change( p_input, "chapter", VLC_VAR_ADDCHOICE, &val, NULL ); - } + for( i = 1; i <= p_area->i_part_nb; i++ ) + { + val.i_int = i; + var_Change( p_input, "chapter", VLC_VAR_ADDCHOICE, &val, NULL ); + } } /* i_title >= 0 */ else diff --git a/modules/access/v4l/videodev_mjpeg.h b/modules/access/v4l/videodev_mjpeg.h index 1285d77e5d..8d83a65de9 100644 --- a/modules/access/v4l/videodev_mjpeg.h +++ b/modules/access/v4l/videodev_mjpeg.h @@ -2,7 +2,7 @@ * Copyright (C) lavrec (see http://mjpeg.sourceforge.net) * ( XXX This file was get from the driver-zoran package and it is under GPL) * - * $Id: videodev_mjpeg.h,v 1.1 2003/05/31 01:23:29 fenrir Exp $ + * $Id: videodev_mjpeg.h,v 1.2 2003/12/22 14:32:55 sam Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,16 +93,16 @@ struct mjpeg_params #define JPEG_MARKER_COM (1<<6) /* Comment segment */ #define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */ - int VFIFO_FB; /* Flag for enabling Video Fifo Feedback. - If this flag is turned on and JPEG decompressing - is going to the screen, the decompress process - is stopped every time the Video Fifo is full. - This enables a smooth decompress to the screen - but the video output signal will get scrambled */ + int VFIFO_FB; /* Flag for enabling Video Fifo Feedback. + If this flag is turned on and JPEG decompressing + is going to the screen, the decompress process + is stopped every time the Video Fifo is full. + This enables a smooth decompress to the screen + but the video output signal will get scrambled */ /* Misc */ - char reserved[312]; /* Makes 512 bytes for this structure */ + char reserved[312]; /* Makes 512 bytes for this structure */ }; struct mjpeg_requestbuffers diff --git a/modules/access/vcdx/access.c b/modules/access/vcdx/access.c index 769c8f4a3e..ae44dd0786 100644 --- a/modules/access/vcdx/access.c +++ b/modules/access/vcdx/access.c @@ -4,9 +4,9 @@ * to go here. ***************************************************************************** * Copyright (C) 2000, 2003 VideoLAN - * $Id: access.c,v 1.12 2003/12/22 00:13:52 sam Exp $ + * $Id: access.c,v 1.13 2003/12/22 14:32:55 sam Exp $ * - * Authors: Rocky Bernstein + * Authors: Rocky Bernstein * Johan Bilien * * This program is free software; you can redistribute it and/or modify @@ -61,19 +61,19 @@ static int VCDRead ( input_thread_t *, byte_t *, size_t ); static int VCDSetProgram ( input_thread_t *, pgrm_descriptor_t * ); /* Now those which are strictly internal */ -static void VCDSetOrigin ( input_thread_t *, lsn_t origin_lsn, - lsn_t cur_lsn, lsn_t end_lsn, +static void VCDSetOrigin ( input_thread_t *, lsn_t origin_lsn, + lsn_t cur_lsn, lsn_t end_lsn, int cur_entry, track_t track ); static int VCDEntryPoints ( input_thread_t * ); static int VCDLIDs ( input_thread_t * ); static int VCDSegments ( input_thread_t * ); static void VCDTracks ( input_thread_t * ); -static int VCDReadSector ( vlc_object_t *p_this, - const vcdinfo_obj_t *p_vcd, lsn_t cur_lsn, +static int VCDReadSector ( vlc_object_t *p_this, + const vcdinfo_obj_t *p_vcd, lsn_t cur_lsn, byte_t * p_buffer ); -static char *VCDParse ( input_thread_t *, +static char *VCDParse ( input_thread_t *, /*out*/ vcdinfo_itemid_t * p_itemid , - /*out*/ bool *play_single_item ); + /*out*/ bool *play_single_item ); static void VCDUpdateVar( input_thread_t *p_input, int i_entry, int i_action, const char *varname, const char *label ); @@ -84,7 +84,7 @@ static vcdinfo_obj_t *vcd_Open ( vlc_object_t *p_this, const char *psz_dev ); * Private functions ****************************************************************************/ -/* FIXME: This variable is a hack. Would be nice to eliminate the +/* FIXME: This variable is a hack. Would be nice to eliminate the global-ness. */ static input_thread_t *p_vcd_input = NULL; @@ -97,7 +97,7 @@ cdio_log_handler (cdio_log_level_t level, const char message[]) switch (level) { case CDIO_LOG_DEBUG: case CDIO_LOG_INFO: - if (p_vcd->i_debug & INPUT_DBG_CDIO) + if (p_vcd->i_debug & INPUT_DBG_CDIO) msg_Dbg( p_vcd_input, message); break; case CDIO_LOG_WARN: @@ -109,7 +109,7 @@ cdio_log_handler (cdio_log_level_t level, const char message[]) break; default: msg_Warn( p_vcd_input, message, - _("The above message had unknown log level"), + _("The above message had unknown log level"), level); } return; @@ -135,7 +135,7 @@ vcd_log_handler (vcd_log_level_t level, const char message[]) break; default: msg_Warn( p_vcd_input, "%s\n%s %d", message, - _("The above message had unknown vcdimager log level"), + _("The above message had unknown vcdimager log level"), level); } return; @@ -147,7 +147,7 @@ vcd_log_handler (vcd_log_level_t level, const char message[]) * Returns -1 in case of error, 0 in case of EOF, otherwise the number of * bytes. *****************************************************************************/ -static int +static int VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) { thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; @@ -171,11 +171,11 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) vcdplayer_read_status_t read_status; /* We've run off of the end of this entry. Do we continue or stop? */ - dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), + dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), "end reached, cur: %u", p_vcd->cur_lsn ); - read_status = vcdplayer_pbc_is_on( p_vcd ) - ? vcdplayer_pbc_nav( p_input ) + read_status = vcdplayer_pbc_is_on( p_vcd ) + ? vcdplayer_pbc_nav( p_input ) : vcdplayer_non_pbc_nav( p_input ); switch (read_status) { @@ -185,12 +185,12 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) /* Some sort of error. */ return i_read; - case READ_STILL_FRAME: + case READ_STILL_FRAME: { - /* Reached the end of a still frame. */ + /* Reached the end of a still frame. */ byte_t * p_buf = p_buffer; - pgrm_descriptor_t * p_pgrm = p_input->stream.p_selected_program;; + pgrm_descriptor_t * p_pgrm = p_input->stream.p_selected_program;; p_buf += (i_index*M2F2_SECTOR_SIZE); memset(p_buf, 0, M2F2_SECTOR_SIZE); @@ -199,21 +199,21 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) dbg_print(INPUT_DBG_STILL, "Handled still event"); #if 1 - p_vcd->p_intf->p_sys->b_still = 1; - input_SetStatus( p_input, INPUT_STATUS_PAUSE ); + p_vcd->p_intf->p_sys->b_still = 1; + input_SetStatus( p_input, INPUT_STATUS_PAUSE ); #endif - vlc_mutex_lock( &p_input->stream.stream_lock ); + vlc_mutex_lock( &p_input->stream.stream_lock ); - p_pgrm = p_input->stream.p_selected_program; - p_pgrm->i_synchro_state = SYNCHRO_REINIT; + p_pgrm = p_input->stream.p_selected_program; + p_pgrm->i_synchro_state = SYNCHRO_REINIT; - vlc_mutex_unlock( &p_input->stream.stream_lock ); + vlc_mutex_unlock( &p_input->stream.stream_lock ); - input_ClockManageControl( p_input, p_pgrm, 0 ); + input_ClockManageControl( p_input, p_pgrm, 0 ); - p_vcd->p_intf->p_sys->b_still = 1; - input_SetStatus( p_input, INPUT_STATUS_PAUSE ); + p_vcd->p_intf->p_sys->b_still = 1; + input_SetStatus( p_input, INPUT_STATUS_PAUSE ); return i_read + M2F2_SECTOR_SIZE; } @@ -224,15 +224,15 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) } if ( VCDReadSector( VLC_OBJECT(p_input), p_vcd->vcd, - p_vcd->cur_lsn, + p_vcd->cur_lsn, p_buffer + (i_index*M2F2_SECTOR_SIZE) ) < 0 ) { LOG_ERR ("could not read sector %d", p_vcd->cur_lsn ); return -1; } - + p_vcd->cur_lsn ++; - + /* Update chapter */ if( p_vcd->b_valid_ep && /* FIXME kludge so that read does not update chapter @@ -241,17 +241,17 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) !p_input->stream.p_new_area ) { unsigned int i_entry = p_input->stream.p_selected_area->i_part; - + vlc_mutex_lock( &p_input->stream.stream_lock ); - + if( i_entry < p_vcd->num_entries && p_vcd->cur_lsn >= p_vcd->p_entries[i_entry+1] ) { - dbg_print( INPUT_DBG_PBC, + dbg_print( INPUT_DBG_PBC, "new entry, i_entry %d, sector %d, es %d", - i_entry, p_vcd->cur_lsn, + i_entry, p_vcd->cur_lsn, p_vcd->p_entries[i_entry] ); - p_vcd->play_item.num = + p_vcd->play_item.num = ++ p_input->stream.p_selected_area->i_part; p_vcd->play_item.type = VCDINFO_ITEM_TYPE_ENTRY; VCDUpdateVar( p_input, p_vcd->play_item.num, VLC_VAR_SETVALUE, @@ -284,7 +284,7 @@ VCDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) /***************************************************************************** * VCDSetProgram: Does nothing since a VCD is mono_program *****************************************************************************/ -static int +static int VCDSetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_program) { thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; @@ -294,13 +294,13 @@ VCDSetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_program) /***************************************************************************** - * VCDSetArea: initialize internal data structures and input stream data + * VCDSetArea: initialize internal data structures and input stream data so set subsequent reading and seeking to reflect that we are at track x, entry or segment y. - This is called for each user navigation request, e.g. the GUI - Chapter/Title selections or in initial MRL parsing. + This is called for each user navigation request, e.g. the GUI + Chapter/Title selections or in initial MRL parsing. ****************************************************************************/ -int +int VCDSetArea( input_thread_t * p_input, input_area_t * p_area ) { thread_vcd_data_t *p_vcd = (thread_vcd_data_t*)p_input->p_access_data; @@ -311,9 +311,9 @@ VCDSetArea( input_thread_t * p_input, input_area_t * p_area ) dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT), "track: %d, entry %d, seekable %d, area %lx, select area %lx ", - i_track, i_entry, old_seekable, - (long unsigned int) p_area, - (long unsigned int) p_input->stream.p_selected_area ); + i_track, i_entry, old_seekable, + (long unsigned int) p_area, + (long unsigned int) p_input->stream.p_selected_area ); /* we can't use the interface slider until initilization is complete */ p_input->stream.b_seekable = 0; @@ -323,31 +323,31 @@ VCDSetArea( input_thread_t * p_input, input_area_t * p_area ) unsigned int i; /* If is the result of a track change, make the entry valid. */ - if (i_entry < p_area->i_plugin_data || i_entry >= i_nb) + if (i_entry < p_area->i_plugin_data || i_entry >= i_nb) i_entry = p_area->i_plugin_data; /* Change the default area */ p_input->stream.p_selected_area = p_area; /* Update the navigation variables without triggering a callback */ - VCDUpdateVar( p_input, i_track, VLC_VAR_SETVALUE, "title", + VCDUpdateVar( p_input, i_track, VLC_VAR_SETVALUE, "title", "Setting track"); var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL ); for( i = p_area->i_plugin_data; i < i_nb; i++ ) { - VCDUpdateVar( p_input, i , VLC_VAR_ADDCHOICE, + VCDUpdateVar( p_input, i , VLC_VAR_ADDCHOICE, "chapter", "Adding entry choice"); } } - if (i_track == 0) - VCDSetOrigin( p_input, p_vcd->p_segments[i_entry], + if (i_track == 0) + VCDSetOrigin( p_input, p_vcd->p_segments[i_entry], p_vcd->p_segments[i_entry], p_vcd->p_segments[i_entry+1], i_entry, 0 ); else - VCDSetOrigin( p_input, p_vcd->p_sectors[i_track], - vcdinfo_get_entry_lsn(p_vcd->vcd, i_entry), + VCDSetOrigin( p_input, p_vcd->p_sectors[i_track], + vcdinfo_get_entry_lsn(p_vcd->vcd, i_entry), p_vcd->p_sectors[i_track+1], i_entry, i_track ); @@ -362,7 +362,7 @@ VCDSetArea( input_thread_t * p_input, input_area_t * p_area ) /**************************************************************************** * VCDSeek ****************************************************************************/ -void +void VCDSeek( input_thread_t * p_input, off_t i_off ) { thread_vcd_data_t * p_vcd; @@ -381,7 +381,7 @@ VCDSeek( input_thread_t * p_input, off_t i_off ) { if( p_vcd->cur_lsn < p_vcd->p_entries[i_entry] ) { - VCDUpdateVar( p_input, i_entry, VLC_VAR_SETVALUE, + VCDUpdateVar( p_input, i_entry, VLC_VAR_SETVALUE, "chapter", "Setting entry" ); break; } @@ -394,8 +394,8 @@ VCDSeek( input_thread_t * p_input, off_t i_off ) p_input->stream.p_selected_area->i_tell = i_off; dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_SEEK), - "orig %d, cur: %d, offset: %lld, start: %lld, entry %d", - p_vcd->origin_lsn, p_vcd->cur_lsn, i_off, + "orig %d, cur: %d, offset: %lld, start: %lld, entry %d", + p_vcd->origin_lsn, p_vcd->cur_lsn, i_off, p_input->stream.p_selected_area->i_start, i_entry ); vlc_mutex_unlock( &p_input->stream.stream_lock ); @@ -405,17 +405,17 @@ VCDSeek( input_thread_t * p_input, off_t i_off ) VCDPlay: set up internal structures so seeking/reading places an item. itemid: the thing to play. user_entry: true if itemid is a user selection (rather than internally- - generated selection such as via PBC) in which case we may have to adjust - for differences in numbering. + generated selection such as via PBC) in which case we may have to adjust + for differences in numbering. *****************************************************************************/ int VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) { thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; input_area_t * p_area; - - dbg_print(INPUT_DBG_CALL, "itemid.num: %d, itemid.type: %d\n", - itemid.num, itemid.type); + + dbg_print(INPUT_DBG_CALL, "itemid.num: %d, itemid.type: %d\n", + itemid.num, itemid.type); if (!p_input->p_access_data) return VLC_EGENERIC; @@ -438,22 +438,22 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) p_area->i_part = p_area->i_plugin_data; p_input->stream.b_seekable = 1; break; - case VCDINFO_ITEM_TYPE_SEGMENT: + case VCDINFO_ITEM_TYPE_SEGMENT: /* Valid segments go from 0...num_segments-1. */ if (itemid.num >= p_vcd->num_segments) { LOG_ERR ( "Invalid segment number: %d", itemid.num ); return VLC_EGENERIC; } else { - vcdinfo_video_segment_type_t segtype = + vcdinfo_video_segment_type_t segtype = vcdinfo_get_video_type(p_vcd->vcd, itemid.num); - - dbg_print(INPUT_DBG_PBC, "%s (%d), seg_num: %d", - vcdinfo_video_type2str(p_vcd->vcd, itemid.num), + + dbg_print(INPUT_DBG_PBC, "%s (%d), seg_num: %d", + vcdinfo_video_type2str(p_vcd->vcd, itemid.num), (int) segtype, itemid.num); - + p_area = area[0]; p_area->i_part = itemid.num; - + switch (segtype) { case VCDINFO_FILES_VIDEO_NTSC_STILL: @@ -469,7 +469,7 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) } } break; - + case VCDINFO_ITEM_TYPE_LID: /* LIDs go from 1..num_lids. */ if (itemid.num == 0 || itemid.num > p_vcd->num_lids) { @@ -478,14 +478,14 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) } else { p_vcd->cur_lid = itemid.num; vcdinfo_lid_get_pxd(p_vcd->vcd, &(p_vcd->pxd), itemid.num); - + switch (p_vcd->pxd.descriptor_type) { - + case PSD_TYPE_SELECTION_LIST: case PSD_TYPE_EXT_SELECTION_LIST: { vcdinfo_itemid_t trans_itemid; uint16_t trans_itemid_num; - + if (p_vcd->pxd.psd == NULL) return VLC_EGENERIC; trans_itemid_num = vcdinf_psd_get_itemid(p_vcd->pxd.psd); vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid); @@ -494,18 +494,18 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) return VCDPlay( p_input, trans_itemid ); break; } - + case PSD_TYPE_PLAY_LIST: { if (p_vcd->pxd.pld == NULL) return VLC_EGENERIC; p_vcd->pdi = -1; - return vcdplayer_inc_play_item(p_input) + return vcdplayer_inc_play_item(p_input) ? VLC_SUCCESS : VLC_EGENERIC; break; } - + case PSD_TYPE_END_LIST: case PSD_TYPE_COMMAND_LIST: - + default: ; } @@ -534,11 +534,11 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) p_vcd->play_item = itemid; - dbg_print( (INPUT_DBG_CALL), - "i_start %lld, i_size: %lld, i_tell: %lld, lsn %d", - p_area->i_start, p_area->i_size, + dbg_print( (INPUT_DBG_CALL), + "i_start %lld, i_size: %lld, i_tell: %lld, lsn %d", + p_area->i_start, p_area->i_size, p_area->i_tell, p_vcd->cur_lsn ); - + return VLC_SUCCESS; } @@ -547,7 +547,7 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid ) and initializes area information with that. Before calling this track information should have been read in. *****************************************************************************/ -static int +static int VCDEntryPoints( input_thread_t * p_input ) { thread_vcd_data_t * p_vcd; @@ -558,9 +558,9 @@ VCDEntryPoints( input_thread_t * p_input ) p_vcd = (thread_vcd_data_t *) p_input->p_access_data; i_nb = vcdinfo_get_num_entries(p_vcd->vcd); - if (0 == i_nb) + if (0 == i_nb) return -1; - + p_vcd->p_entries = malloc( sizeof( lba_t ) * i_nb ); if( p_vcd->p_entries == NULL ) @@ -576,7 +576,7 @@ VCDEntryPoints( input_thread_t * p_input ) track_t i_track = vcdinfo_get_track(p_vcd->vcd, i); if( i_track <= p_input->stream.i_area_nb ) { - p_vcd->p_entries[i] = + p_vcd->p_entries[i] = vcdinfo_get_entry_lsn(p_vcd->vcd, i); p_input->stream.pp_areas[i_track]->i_part_nb ++; @@ -608,7 +608,7 @@ VCDSegments( input_thread_t * p_input ) thread_vcd_data_t * p_vcd; unsigned int i; unsigned int num_segments; - + p_vcd = (thread_vcd_data_t *) p_input->p_access_data; num_segments = p_vcd->num_segments = vcdinfo_get_num_segments(p_vcd->vcd); @@ -620,23 +620,23 @@ VCDSegments( input_thread_t * p_input ) area[0]->i_plugin_data = 0; input_DelArea( p_input, area[0] ); input_AddArea( p_input, 0, 0 ); - - area[0]->i_start = (off_t)p_vcd->p_sectors[0] + + area[0]->i_start = (off_t)p_vcd->p_sectors[0] * (off_t)M2F2_SECTOR_SIZE; area[0]->i_size = (off_t)(p_vcd->p_sectors[1] - p_vcd->p_sectors[0]) * (off_t)M2F2_SECTOR_SIZE; - + /* Default Segment */ area[0]->i_part = 0; - + /* i_plugin_data is used to store which entry point is the first of the track (area) */ area[0]->i_plugin_data = 0; area[0]->i_part_nb = 0; - - dbg_print( INPUT_DBG_MRL, - "area[0] id: %d, i_start: %lld, i_size: %lld", + + dbg_print( INPUT_DBG_MRL, + "area[0] id: %d, i_start: %lld, i_size: %lld", area[0]->i_id, area[0]->i_start, area[0]->i_size ); if (num_segments == 0) return 0; @@ -654,12 +654,12 @@ VCDSegments( input_thread_t * p_input ) /* Update the navigation variables without triggering a callback */ VCDUpdateVar( p_input, 0, VLC_VAR_SETVALUE, "title", "Setting track" ); var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL ); - + for( i = 0 ; i < num_segments ; i++ ) { p_vcd->p_segments[i] = vcdinfo_get_seg_lsn(p_vcd->vcd, i); area[0]->i_part_nb ++; - VCDUpdateVar( p_input, i , VLC_VAR_ADDCHOICE, + VCDUpdateVar( p_input, i , VLC_VAR_ADDCHOICE, "chapter", "Adding segment choice"); } @@ -667,12 +667,12 @@ VCDSegments( input_thread_t * p_input ) p_vcd->p_segments[num_segments] = p_vcd->p_segments[num_segments-1]+ vcdinfo_get_seg_sector_count(p_vcd->vcd, num_segments-1); - + return 0; } /***************************************************************************** - VCDTracks: initializes area information. + VCDTracks: initializes area information. Before calling this track information should have been read in. *****************************************************************************/ static void @@ -694,7 +694,7 @@ VCDTracks( input_thread_t * p_input ) input_AddArea( p_input, i, i ); /* Absolute start byte offset and byte size */ - area[i]->i_start = (off_t) p_vcd->p_sectors[i] + area[i]->i_start = (off_t) p_vcd->p_sectors[i] * (off_t)M2F2_SECTOR_SIZE; area[i]->i_size = (off_t)(p_vcd->p_sectors[i+1] - p_vcd->p_sectors[i]) * (off_t)M2F2_SECTOR_SIZE; @@ -706,8 +706,8 @@ VCDTracks( input_thread_t * p_input ) * of the track (area) */ area[i]->i_plugin_data = 0; - dbg_print( INPUT_DBG_MRL, - "area[%d] id: %d, i_start: %lld, i_size: %lld", + dbg_print( INPUT_DBG_MRL, + "area[%d] id: %d, i_start: %lld, i_size: %lld", i, area[i]->i_id, area[i]->i_start, area[i]->i_size ); } @@ -719,7 +719,7 @@ VCDTracks( input_thread_t * p_input ) /***************************************************************************** VCDLIDs: Reads the LIST IDs from the LOT. *****************************************************************************/ -static int +static int VCDLIDs( input_thread_t * p_input ) { thread_vcd_data_t *p_vcd = (thread_vcd_data_t *) p_input->p_access_data; @@ -728,22 +728,22 @@ VCDLIDs( input_thread_t * p_input ) p_vcd->cur_lid = VCDINFO_INVALID_ENTRY; if (vcdinfo_read_psd (p_vcd->vcd)) { - + vcdinfo_visit_lot (p_vcd->vcd, false); - + #if FIXED - /* - We need to change libvcdinfo to be more robust when there are - problems reading the extended PSD. Given that area-highlighting and + /* + We need to change libvcdinfo to be more robust when there are + problems reading the extended PSD. Given that area-highlighting and selection features in the extended PSD haven't been implemented, it's best then to not try to read this at all. */ if (vcdinfo_get_psd_x_size(p_vcd->vcd)) vcdinfo_visit_lot (p_vcd->vcd, true); -#endif +#endif } - dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL), + dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL), "num LIDs=%d", p_vcd->num_lids); return 0; @@ -752,9 +752,9 @@ VCDLIDs( input_thread_t * p_input ) /***************************************************************************** * VCDParse: parse command line *****************************************************************************/ -static char * +static char * VCDParse( input_thread_t * p_input, /*out*/ vcdinfo_itemid_t * p_itemid, - /*out*/ bool *play_single_item ) + /*out*/ bool *play_single_item ) { thread_vcd_data_t *p_vcd = (thread_vcd_data_t *)p_input->p_access_data; char * psz_parser; @@ -769,7 +769,7 @@ VCDParse( input_thread_t * p_input, /*out*/ vcdinfo_itemid_t * p_itemid, p_itemid->type=VCDINFO_ITEM_TYPE_ENTRY; p_itemid->num=0; } - + #ifdef WIN32 /* On Win32 we want the VCD access plugin to be explicitly requested, * we end up with lots of problems otherwise */ @@ -792,60 +792,60 @@ VCDParse( input_thread_t * p_input, /*out*/ vcdinfo_itemid_t * p_itemid, if( *psz_parser == '@' ) { - /* Found the divide between the source name and the + /* Found the divide between the source name and the type+entry number. */ unsigned int num; - + *psz_parser = '\0'; ++psz_parser; if( *psz_parser ) { switch(*psz_parser) { - case 'E': + case 'E': p_itemid->type = VCDINFO_ITEM_TYPE_ENTRY; ++psz_parser; - *play_single_item = true; + *play_single_item = true; break; - case 'P': + case 'P': p_itemid->type = VCDINFO_ITEM_TYPE_LID; ++psz_parser; - *play_single_item = false; + *play_single_item = false; break; - case 'S': + case 'S': p_itemid->type = VCDINFO_ITEM_TYPE_SEGMENT; ++psz_parser; - *play_single_item = true; + *play_single_item = true; break; - case 'T': + case 'T': p_itemid->type = VCDINFO_ITEM_TYPE_TRACK; ++psz_parser; - *play_single_item = true; + *play_single_item = true; break; default: ; } } - + num = strtol( psz_parser, &psz_next, 10 ); - if ( *psz_parser != '\0' && *psz_next == '\0') + if ( *psz_parser != '\0' && *psz_next == '\0') { p_itemid->num = num; } - + } else { *play_single_item = ( VCDINFO_ITEM_TYPE_LID == p_itemid->type ); } - + if( !*psz_source ) { /* No source specified, so figure it out. */ if( !p_input->psz_access ) return NULL; - + psz_source = config_GetPsz( p_input, "vcd" ); if( !psz_source || 0==strlen(psz_source) ) { /* Scan for a CD-ROM drive with a VCD in it. */ - char **cd_drives = cdio_get_devices_with_cap(NULL, + char **cd_drives = cdio_get_devices_with_cap(NULL, (CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD |CDIO_FS_ANAL_VIDEOCD|CDIO_FS_UNKNOWN), true); @@ -859,18 +859,18 @@ VCDParse( input_thread_t * p_input, /*out*/ vcdinfo_itemid_t * p_itemid, } } - dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL), + dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL), "source=%s entry=%d type=%d", psz_source, p_itemid->num, p_itemid->type); return psz_source; } -/* +/* Set's start origin subsequent seeks/reads */ -static void -VCDSetOrigin( input_thread_t *p_input, lsn_t origin_lsn, +static void +VCDSetOrigin( input_thread_t *p_input, lsn_t origin_lsn, lsn_t cur_lsn, lsn_t end_lsn, int cur_entry, track_t cur_track ) { thread_vcd_data_t * p_vcd = (thread_vcd_data_t *) p_input->p_access_data; @@ -881,7 +881,7 @@ VCDSetOrigin( input_thread_t *p_input, lsn_t origin_lsn, p_vcd->cur_track = cur_track; p_vcd->play_item.num = cur_entry; p_vcd->play_item.type = VCDINFO_ITEM_TYPE_ENTRY; - + dbg_print( (INPUT_DBG_CALL|INPUT_DBG_LSN), "origin: %d, cur_lsn: %d, end_lsn: %d, entry: %d, track: %d", origin_lsn, cur_lsn, end_lsn, cur_entry, cur_track ); @@ -889,7 +889,7 @@ VCDSetOrigin( input_thread_t *p_input, lsn_t origin_lsn, p_input->stream.p_selected_area->i_tell = (off_t) (p_vcd->cur_lsn - p_vcd->origin_lsn) * (off_t)M2F2_SECTOR_SIZE; - VCDUpdateVar( p_input, cur_entry, VLC_VAR_SETVALUE, + VCDUpdateVar( p_input, cur_entry, VLC_VAR_SETVALUE, "chapter", "Setting entry"); } @@ -905,7 +905,7 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev ) if( !psz_dev ) return NULL; actual_dev=strdup(psz_dev); - if ( vcdinfo_open(&p_vcdobj, &actual_dev, DRIVER_UNKNOWN, NULL) != + if ( vcdinfo_open(&p_vcdobj, &actual_dev, DRIVER_UNKNOWN, NULL) != VCDINFO_OPEN_VCD) { free(actual_dev); return NULL; @@ -918,7 +918,7 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev ) /**************************************************************************** * VCDReadSector: Read a sector (2324 bytes) ****************************************************************************/ -static int +static int VCDReadSector( vlc_object_t *p_this, const vcdinfo_obj_t *p_vcd, lsn_t cur_lsn, byte_t * p_buffer ) { @@ -927,17 +927,17 @@ VCDReadSector( vlc_object_t *p_this, const vcdinfo_obj_t *p_vcd, uint8_t data [M2F2_SECTOR_SIZE]; } vcdsector_t; vcdsector_t vcd_sector; - - if (cdio_read_mode2_sector(vcdinfo_get_cd_image(p_vcd), - &vcd_sector, cur_lsn, true) + + if (cdio_read_mode2_sector(vcdinfo_get_cd_image(p_vcd), + &vcd_sector, cur_lsn, true) != 0) { msg_Warn( p_this, "Could not read LSN %d", cur_lsn ); return -1; } - + memcpy (p_buffer, vcd_sector.data, M2F2_SECTOR_SIZE); - + return( 0 ); } @@ -959,20 +959,20 @@ VCDUpdateVar( input_thread_t *p_input, int i_num, int i_action, #define meta_info_add_str(title, str) \ - if ( str ) { \ - dbg_print( INPUT_DBG_META, "field: %s: %s\n", title, str); \ - input_AddInfo( p_cat, _(title), "%s", str ); \ + if ( str ) { \ + dbg_print( INPUT_DBG_META, "field: %s: %s\n", title, str); \ + input_AddInfo( p_cat, _(title), "%s", str ); \ } #define meta_info_add_num(title, num) \ - dbg_print( INPUT_DBG_META, "field %s: %d\n", title, num); \ - input_AddInfo( p_cat, _(title), "%d", num ); \ + dbg_print( INPUT_DBG_META, "field %s: %d\n", title, num); \ + input_AddInfo( p_cat, _(title), "%d", num ); \ static void InformationCreate( input_thread_t *p_input ) { thread_vcd_data_t *p_vcd = (thread_vcd_data_t *) p_input->p_access_data; input_info_category_t *p_cat; - + p_cat = input_InfoCategory( p_input, "General" ); meta_info_add_str( "VCD Format", vcdinfo_get_format_version_str(p_vcd->vcd)); @@ -992,47 +992,47 @@ static void InformationCreate( input_thread_t *p_input ) } -#define add_format_str_info(val) \ - { \ - const char *str = val; \ - unsigned int len; \ - if (val != NULL) { \ - len=strlen(str); \ - if (len != 0) { \ - strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \ - tp += len; \ - } \ - saw_control_prefix = false; \ - } \ +#define add_format_str_info(val) \ + { \ + const char *str = val; \ + unsigned int len; \ + if (val != NULL) { \ + len=strlen(str); \ + if (len != 0) { \ + strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \ + tp += len; \ + } \ + saw_control_prefix = false; \ + } \ } -#define add_format_num_info(val, fmt) \ - { \ - char num_str[10]; \ +#define add_format_num_info(val, fmt) \ + { \ + char num_str[10]; \ unsigned int len; \ - sprintf(num_str, fmt, val); \ + sprintf(num_str, fmt, val); \ len=strlen(num_str); \ - if (len != 0) { \ - strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \ - tp += len; \ - } \ - saw_control_prefix = false; \ + if (len != 0) { \ + strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \ + tp += len; \ + } \ + saw_control_prefix = false; \ } /*! Take a format string and expand escape sequences, that is sequences that - begin with %, with information from the current VCD. + begin with %, with information from the current VCD. The expanded string is returned. Here is a list of escape sequences: - %A : The album information + %A : The album information %C : The VCD volume count - the number of CD's in the collection. - %c : The VCD volume num - the number of the CD in the collection. + %c : The VCD volume num - the number of the CD in the collection. %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT... %L : The playlist ID prefixed with " LID" if it exists %M : MRL %N : The current number of the %I - a decimal number - %P : The publisher ID + %P : The publisher ID %p : The preparer ID %S : If we are in a segment (menu), the kind of segment %T : The track number @@ -1043,8 +1043,8 @@ static void InformationCreate( input_thread_t *p_input ) */ static char * VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, - const char format_str[], const char *mrl, - const vcdinfo_itemid_t *itemid) + const char format_str[], const char *mrl, + const vcdinfo_itemid_t *itemid) { #define TEMP_STR_SIZE 256 #define TEMP_STR_LEN (TEMP_STR_SIZE-1) @@ -1067,12 +1067,12 @@ VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, switch(format_str[i]) { case '%': if (saw_control_prefix) { - *tp++ = '%'; + *tp++ = '%'; } saw_control_prefix = !saw_control_prefix; break; case 'A': - add_format_str_info(vcdinfo_strip_trail(vcdinfo_get_album_id(p_vcd->vcd), + add_format_str_info(vcdinfo_strip_trail(vcdinfo_get_album_id(p_vcd->vcd), MAX_ALBUM_LEN)); break; @@ -1090,32 +1090,32 @@ VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, case 'I': { - switch (itemid->type) { - case VCDINFO_ITEM_TYPE_TRACK: - strncat(tp, _("Track"), TEMP_STR_LEN-(tp-temp_str)); - tp += strlen(_("Track")); - break; - case VCDINFO_ITEM_TYPE_ENTRY: - strncat(tp, _("Entry"), TEMP_STR_LEN-(tp-temp_str)); - tp += strlen(_("Entry")); - break; - case VCDINFO_ITEM_TYPE_SEGMENT: - strncat(tp, _("Segment"), TEMP_STR_LEN-(tp-temp_str)); - tp += strlen(_("Segment")); - break; - case VCDINFO_ITEM_TYPE_LID: - strncat(tp, _("List ID"), TEMP_STR_LEN-(tp-temp_str)); - tp += strlen(_("List ID")); - break; - case VCDINFO_ITEM_TYPE_SPAREID2: - strncat(tp, _("Navigation"), TEMP_STR_LEN-(tp-temp_str)); - tp += strlen(_("Navigation")); - break; - default: - /* What to do? */ + switch (itemid->type) { + case VCDINFO_ITEM_TYPE_TRACK: + strncat(tp, _("Track"), TEMP_STR_LEN-(tp-temp_str)); + tp += strlen(_("Track")); + break; + case VCDINFO_ITEM_TYPE_ENTRY: + strncat(tp, _("Entry"), TEMP_STR_LEN-(tp-temp_str)); + tp += strlen(_("Entry")); + break; + case VCDINFO_ITEM_TYPE_SEGMENT: + strncat(tp, _("Segment"), TEMP_STR_LEN-(tp-temp_str)); + tp += strlen(_("Segment")); + break; + case VCDINFO_ITEM_TYPE_LID: + strncat(tp, _("List ID"), TEMP_STR_LEN-(tp-temp_str)); + tp += strlen(_("List ID")); + break; + case VCDINFO_ITEM_TYPE_SPAREID2: + strncat(tp, _("Navigation"), TEMP_STR_LEN-(tp-temp_str)); + tp += strlen(_("Navigation")); + break; + default: + /* What to do? */ ; - } - saw_control_prefix = false; + } + saw_control_prefix = false; } break; @@ -1149,7 +1149,7 @@ VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, if ( VCDINFO_ITEM_TYPE_SEGMENT==itemid->type ) { char seg_type_str[10]; - sprintf(seg_type_str, " %s", + sprintf(seg_type_str, " %s", vcdinfo_video_type2str(p_vcd->vcd, itemid->num)); strncat(tp, seg_type_str, TEMP_STR_LEN-(tp-temp_str)); tp += strlen(seg_type_str); @@ -1170,7 +1170,7 @@ VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, break; default: - *tp++ = '%'; + *tp++ = '%'; *tp++ = format_str[i]; saw_control_prefix = false; } @@ -1179,13 +1179,13 @@ VCDFormatStr(const input_thread_t *p_input, thread_vcd_data_t *p_vcd, } static void -VCDCreatePlayListItem(const input_thread_t *p_input, - thread_vcd_data_t *p_vcd, - playlist_t *p_playlist, - const vcdinfo_itemid_t *itemid, - char *psz_mrl, int psz_mrl_max, - const char *psz_source, int playlist_operation, - int i_pos) +VCDCreatePlayListItem(const input_thread_t *p_input, + thread_vcd_data_t *p_vcd, + playlist_t *p_playlist, + const vcdinfo_itemid_t *itemid, + char *psz_mrl, int psz_mrl_max, + const char *psz_source, int playlist_operation, + int i_pos) { mtime_t i_duration = -1; char *p_author; @@ -1193,10 +1193,10 @@ VCDCreatePlayListItem(const input_thread_t *p_input, char c_type; switch(itemid->type) { - case VCDINFO_ITEM_TYPE_TRACK: + case VCDINFO_ITEM_TYPE_TRACK: c_type='T'; break; - case VCDINFO_ITEM_TYPE_SEGMENT: + case VCDINFO_ITEM_TYPE_SEGMENT: c_type='S'; break; case VCDINFO_ITEM_TYPE_LID: @@ -1209,22 +1209,22 @@ VCDCreatePlayListItem(const input_thread_t *p_input, c_type='?'; break; } - - snprintf(psz_mrl, psz_mrl_max, "%s%s@%c%u", VCD_MRL_PREFIX, psz_source, - c_type, itemid->num); - - p_title = - VCDFormatStr( p_input, p_vcd, - config_GetPsz( p_input, MODULE_STRING "-title-format" ), - psz_mrl, itemid ); - - playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration, - 0, 0, playlist_operation, i_pos ); - - p_author = - VCDFormatStr( p_input, p_vcd, - config_GetPsz( p_input, MODULE_STRING "-author-format" ), - psz_mrl, itemid ); + + snprintf(psz_mrl, psz_mrl_max, "%s%s@%c%u", VCD_MRL_PREFIX, psz_source, + c_type, itemid->num); + + p_title = + VCDFormatStr( p_input, p_vcd, + config_GetPsz( p_input, MODULE_STRING "-title-format" ), + psz_mrl, itemid ); + + playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration, + 0, 0, playlist_operation, i_pos ); + + p_author = + VCDFormatStr( p_input, p_vcd, + config_GetPsz( p_input, MODULE_STRING "-author-format" ), + psz_mrl, itemid ); /* FIXME: This is horrible, but until the playlist interface is fixed up something like this has to be done for the "Author" field. @@ -1235,14 +1235,14 @@ VCDCreatePlayListItem(const input_thread_t *p_input, } static int -VCDFixupPlayList( input_thread_t *p_input, thread_vcd_data_t *p_vcd, - const char *psz_source, vcdinfo_itemid_t *itemid, - bool play_single_item ) +VCDFixupPlayList( input_thread_t *p_input, thread_vcd_data_t *p_vcd, + const char *psz_source, vcdinfo_itemid_t *itemid, + bool play_single_item ) { unsigned int i; playlist_t * p_playlist; char * psz_mrl; - unsigned int psz_mrl_max = strlen(VCD_MRL_PREFIX) + strlen(psz_source) + + unsigned int psz_mrl_max = strlen(VCD_MRL_PREFIX) + strlen(psz_source) + strlen("@T") + strlen("100") + 1; psz_mrl = malloc( psz_mrl_max ); @@ -1254,7 +1254,7 @@ VCDFixupPlayList( input_thread_t *p_input, thread_vcd_data_t *p_vcd, } p_playlist = (playlist_t *) vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, - FIND_ANYWHERE ); + FIND_ANYWHERE ); if( !p_playlist ) { msg_Warn( p_input, "can't find playlist" ); @@ -1269,26 +1269,26 @@ VCDFixupPlayList( input_thread_t *p_input, thread_vcd_data_t *p_vcd, more mature. */ VCDCreatePlayListItem(p_input, p_vcd, p_playlist, itemid, - psz_mrl, psz_mrl_max, psz_source, PLAYLIST_REPLACE, - p_playlist->i_index); + psz_mrl, psz_mrl_max, psz_source, PLAYLIST_REPLACE, + p_playlist->i_index); } else { vcdinfo_itemid_t list_itemid; list_itemid.type=VCDINFO_ITEM_TYPE_ENTRY; - + playlist_Delete( p_playlist, p_playlist->i_index); for( i = 0 ; i < p_vcd->num_entries ; i++ ) { - list_itemid.num=i; - VCDCreatePlayListItem(p_input, p_vcd, p_playlist, &list_itemid, - psz_mrl, psz_mrl_max, psz_source, - PLAYLIST_APPEND, PLAYLIST_END); + list_itemid.num=i; + VCDCreatePlayListItem(p_input, p_vcd, p_playlist, &list_itemid, + psz_mrl, psz_mrl_max, psz_source, + PLAYLIST_APPEND, PLAYLIST_END); } playlist_Command( p_playlist, PLAYLIST_GOTO, 0 ); } - + vlc_object_release( p_playlist ); free(psz_mrl); return 0; @@ -1299,16 +1299,16 @@ VCDFixupPlayList( input_thread_t *p_input, thread_vcd_data_t *p_vcd, *****************************************************************************/ int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name, - vlc_value_t oldval, vlc_value_t val, void *p_data ) + vlc_value_t oldval, vlc_value_t val, void *p_data ) { thread_vcd_data_t *p_vcd; if (NULL == p_vcd_input) return VLC_EGENERIC; - + p_vcd = (thread_vcd_data_t *)p_vcd_input->p_access_data; if (p_vcd->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { - msg_Dbg( p_vcd_input, "Old debug (x%0x) %d, new debug (x%0x) %d", + msg_Dbg( p_vcd_input, "Old debug (x%0x) %d, new debug (x%0x) %d", p_vcd->i_debug, p_vcd->i_debug, val.i_int, val.i_int); } p_vcd->i_debug = val.i_int; @@ -1317,14 +1317,14 @@ E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name, /***************************************************************************** Open: open VCD. - read in meta-information about VCD: the number of tracks, segments, + read in meta-information about VCD: the number of tracks, segments, entries, size and starting information. Then set up state variables so that we read/seek starting at the location specified. - On success we return VLC_SUCCESS, on memory exhausted VLC_ENOMEM, + On success we return VLC_SUCCESS, on memory exhausted VLC_ENOMEM, and VLC_EGENERIC for some other error. *****************************************************************************/ -int +int E_(Open) ( vlc_object_t *p_this ) { input_thread_t * p_input = (input_thread_t *)p_this; @@ -1333,7 +1333,7 @@ E_(Open) ( vlc_object_t *p_this ) vcdinfo_itemid_t itemid; bool b_play_ok; bool play_single_item = false; - + p_input->pf_read = VCDRead; p_input->pf_seek = VCDSeek; p_input->pf_set_area = VCDSetArea; @@ -1357,18 +1357,18 @@ E_(Open) ( vlc_object_t *p_this ) psz_source = VCDParse( p_input, &itemid, &play_single_item ); - if ( NULL == psz_source ) + if ( NULL == psz_source ) { free( p_vcd ); return( VLC_EGENERIC ); } - dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT), "source: %s: mrl: %s", - psz_source, p_input->psz_name ); + dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT), "source: %s: mrl: %s", + psz_source, p_input->psz_name ); p_vcd->p_segments = NULL; p_vcd->p_entries = NULL; - + /* set up input */ p_input->i_mtu = VCD_DATA_ONCE; @@ -1386,12 +1386,12 @@ E_(Open) ( vlc_object_t *p_this ) if( !(p_vcd->vcd = vcd_Open( p_this, psz_source )) ) { msg_Warn( p_input, "could not open %s", psz_source ); - goto err_exit; + goto err_exit; } /* Get track information. */ p_vcd->num_tracks = ioctl_GetTracksMap( VLC_OBJECT(p_input), - vcdinfo_get_cd_image(p_vcd->vcd), + vcdinfo_get_cd_image(p_vcd->vcd), &p_vcd->p_sectors ); if( p_vcd->num_tracks < 0 ) LOG_ERR ("unable to count tracks" ); @@ -1400,7 +1400,7 @@ E_(Open) ( vlc_object_t *p_this ) if( p_vcd->num_tracks <= 1) { vcdinfo_close( p_vcd->vcd ); - goto err_exit; + goto err_exit; } /* Set stream and area data */ @@ -1413,14 +1413,14 @@ E_(Open) ( vlc_object_t *p_this ) p_input->stream.i_method = INPUT_METHOD_VCD; p_input->stream.i_area_nb = 1; - + /* Initialize segment information. */ VCDSegments( p_input ); - + /* Initialize track area information. */ VCDTracks( p_input ); - + if( VCDEntryPoints( p_input ) < 0 ) { msg_Warn( p_input, "could not read entry points, will not use them" ); @@ -1433,7 +1433,7 @@ E_(Open) ( vlc_object_t *p_this ) } b_play_ok = (VLC_SUCCESS == VCDPlay( p_input, itemid )); - + vlc_mutex_unlock( &p_input->stream.stream_lock ); if ( ! b_play_ok ) { @@ -1455,7 +1455,7 @@ E_(Open) ( vlc_object_t *p_this ) intf_RunThread( p_vcd->p_intf ); VCDFixupPlayList( p_input, p_vcd, psz_source, &itemid, play_single_item ); - + free( psz_source ); return VLC_SUCCESS; @@ -1468,7 +1468,7 @@ E_(Open) ( vlc_object_t *p_this ) /***************************************************************************** * Close: closes VCD releasing allocated memory. *****************************************************************************/ -void +void E_(Close) ( vlc_object_t *p_this ) { input_thread_t * p_input = (input_thread_t *)p_this; @@ -1486,7 +1486,7 @@ E_(Close) ( vlc_object_t *p_this ) */ if( p_vcd->p_intf != NULL ) { - p_vcd->p_intf = NULL; + p_vcd->p_intf = NULL; } free( p_vcd ); diff --git a/modules/access/vcdx/intf.c b/modules/access/vcdx/intf.c index 6b2ce07092..573c3fe125 100644 --- a/modules/access/vcdx/intf.c +++ b/modules/access/vcdx/intf.c @@ -2,16 +2,16 @@ * intf.c: Video CD interface to handle user interaction and still time ***************************************************************************** * Copyright (C) 2002,2003 VideoLAN - * $Id: intf.c,v 1.11 2003/12/05 05:01:17 rocky Exp $ + * $Id: intf.c,v 1.12 2003/12/22 14:32:55 sam Exp $ * - * Authors: Rocky Bernstein + * Author: Rocky Bernstein * from DVD code by Stéphane Borel * * This program 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. - * + * * This program 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 @@ -96,11 +96,11 @@ static void RunIntf( intf_thread_t *p_intf ) mtime_t mlast = 0; thread_vcd_data_t * p_vcd; input_thread_t * p_input; - + /* What you add to the last input number entry. It accumulates all of the 10_ADD keypresses */ - int number_addend = 0; - + int number_addend = 0; + if( InitThread( p_intf ) < 0 ) { msg_Err( p_intf, "can't initialize intf" ); @@ -108,7 +108,7 @@ static void RunIntf( intf_thread_t *p_intf ) } p_input = p_intf->p_sys->p_input; - p_vcd = p_intf->p_sys->p_vcd = + p_vcd = p_intf->p_sys->p_vcd = (thread_vcd_data_t *) p_input->p_access_data; dbg_print( INPUT_DBG_CALL, "intf initialized" ); @@ -119,14 +119,14 @@ static void RunIntf( intf_thread_t *p_intf ) vlc_mutex_lock( &p_intf->change_lock ); /* - * Have we timed-out in showing a still frame? + * Have we timed-out in showing a still frame? */ if( p_intf->p_sys->b_still && !p_intf->p_sys->b_inf_still ) { if( p_intf->p_sys->m_still_time > 0 ) { /* Update remaining still time */ - dbg_print(INPUT_DBG_STILL, "updating still time"); + dbg_print(INPUT_DBG_STILL, "updating still time"); mtime = mdate(); if( mlast ) { @@ -138,7 +138,7 @@ static void RunIntf( intf_thread_t *p_intf ) else { /* Still time has elasped; set to continue playing. */ - dbg_print(INPUT_DBG_STILL, "wait time done - setting play"); + dbg_print(INPUT_DBG_STILL, "wait time done - setting play"); input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); p_intf->p_sys->m_still_time = 0; @@ -148,146 +148,146 @@ static void RunIntf( intf_thread_t *p_intf ) } /* - * Do we have a keyboard event? + * Do we have a keyboard event? */ if( p_vout && p_intf->p_sys->b_key_pressed ) { - vlc_value_t val; - int i, i_action = -1; - struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys; + vlc_value_t val; + int i, i_action = -1; + struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys; + + p_intf->p_sys->b_key_pressed = VLC_FALSE; - p_intf->p_sys->b_key_pressed = VLC_FALSE; - - /* Find action triggered by hotkey (if any) */ - var_Get( p_intf->p_vlc, "key-pressed", &val ); + /* Find action triggered by hotkey (if any) */ + var_Get( p_intf->p_vlc, "key-pressed", &val ); - dbg_print( INPUT_DBG_EVENT, "Key pressed %d", val.i_int ); + dbg_print( INPUT_DBG_EVENT, "Key pressed %d", val.i_int ); - for( i = 0; p_hotkeys[i].psz_action != NULL; i++ ) + for( i = 0; p_hotkeys[i].psz_action != NULL; i++ ) { - if( p_hotkeys[i].i_key == val.i_int ) + if( p_hotkeys[i].i_key == val.i_int ) { - i_action = p_hotkeys[i].i_action; + i_action = p_hotkeys[i].i_action; } } - - if( i_action != -1) { - switch (i_action) { - - case ACTIONID_NAV_LEFT: - dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_LEFT - prev (%d)", - number_addend ); - do { - vcdplayer_play_prev( p_input ); - } while (number_addend-- > 0); - break; - - case ACTIONID_NAV_RIGHT: - dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_RIGHT - next (%d)", - number_addend ); - do { - vcdplayer_play_next( p_input ); - } while (number_addend-- > 0); - break; - - case ACTIONID_NAV_UP: - dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_UP - return" ); - do { - vcdplayer_play_return( p_input ); - } while (number_addend-- > 0); - break; - - case ACTIONID_NAV_DOWN: - dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_DOWN - default" ); - vcdplayer_play_default( p_input ); - break; - - case ACTIONID_NAV_ACTIVATE: - { - vcdinfo_itemid_t itemid; - itemid.type=p_vcd->play_item.type; - - dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_ACTIVATE" ); - - if ( vcdplayer_pbc_is_on( p_vcd ) && number_addend != 0 ) { - lid_t next_num=vcdinfo_selection_get_lid(p_vcd->vcd, - p_vcd->cur_lid, - number_addend); - if (VCDINFO_INVALID_LID != next_num) { - itemid.num = next_num; - itemid.type = VCDINFO_ITEM_TYPE_LID; - VCDPlay( p_input, itemid ); - } - } else { - itemid.num = number_addend; - VCDPlay( p_input, itemid ); - } - break; - } - } - number_addend = 0; - - /* Any keypress gets rid of still frame waiting. - FIXME - should handle just the ones that cause an action. - */ - if( p_intf->p_sys->b_still ) - { - dbg_print(INPUT_DBG_STILL, "Playing still after activate"); - input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); - p_intf->p_sys->b_still = 0; - p_intf->p_sys->b_inf_still = 0; - p_intf->p_sys->m_still_time = 0; - } - - } else { - unsigned int digit_entered=0; - - switch (val.i_int) { - case '9': - digit_entered++; - case '8': - digit_entered++; - case '7': - digit_entered++; - case '6': - digit_entered++; - case '5': - digit_entered++; - case '4': - digit_entered++; - case '3': - digit_entered++; - case '2': - digit_entered++; - case '1': - digit_entered++; - case '0': - { - number_addend *= 10; - number_addend += digit_entered; - dbg_print( INPUT_DBG_EVENT, - "Added %d. Number is now: %d\n", - digit_entered, number_addend); - break; - } - } - } + + if( i_action != -1) { + switch (i_action) { + + case ACTIONID_NAV_LEFT: + dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_LEFT - prev (%d)", + number_addend ); + do { + vcdplayer_play_prev( p_input ); + } while (number_addend-- > 0); + break; + + case ACTIONID_NAV_RIGHT: + dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_RIGHT - next (%d)", + number_addend ); + do { + vcdplayer_play_next( p_input ); + } while (number_addend-- > 0); + break; + + case ACTIONID_NAV_UP: + dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_UP - return" ); + do { + vcdplayer_play_return( p_input ); + } while (number_addend-- > 0); + break; + + case ACTIONID_NAV_DOWN: + dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_DOWN - default" ); + vcdplayer_play_default( p_input ); + break; + + case ACTIONID_NAV_ACTIVATE: + { + vcdinfo_itemid_t itemid; + itemid.type=p_vcd->play_item.type; + + dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_ACTIVATE" ); + + if ( vcdplayer_pbc_is_on( p_vcd ) && number_addend != 0 ) { + lid_t next_num=vcdinfo_selection_get_lid(p_vcd->vcd, + p_vcd->cur_lid, + number_addend); + if (VCDINFO_INVALID_LID != next_num) { + itemid.num = next_num; + itemid.type = VCDINFO_ITEM_TYPE_LID; + VCDPlay( p_input, itemid ); + } + } else { + itemid.num = number_addend; + VCDPlay( p_input, itemid ); + } + break; + } + } + number_addend = 0; + + /* Any keypress gets rid of still frame waiting. + FIXME - should handle just the ones that cause an action. + */ + if( p_intf->p_sys->b_still ) + { + dbg_print(INPUT_DBG_STILL, "Playing still after activate"); + input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); + p_intf->p_sys->b_still = 0; + p_intf->p_sys->b_inf_still = 0; + p_intf->p_sys->m_still_time = 0; + } + + } else { + unsigned int digit_entered=0; + + switch (val.i_int) { + case '9': + digit_entered++; + case '8': + digit_entered++; + case '7': + digit_entered++; + case '6': + digit_entered++; + case '5': + digit_entered++; + case '4': + digit_entered++; + case '3': + digit_entered++; + case '2': + digit_entered++; + case '1': + digit_entered++; + case '0': + { + number_addend *= 10; + number_addend += digit_entered; + dbg_print( INPUT_DBG_EVENT, + "Added %d. Number is now: %d\n", + digit_entered, number_addend); + break; + } + } + } } - + vlc_mutex_unlock( &p_intf->change_lock ); - + if( p_vout == NULL ) { - p_vout = vlc_object_find( p_intf->p_sys->p_input, - VLC_OBJECT_VOUT, FIND_CHILD ); - if( p_vout ) + p_vout = vlc_object_find( p_intf->p_sys->p_input, + VLC_OBJECT_VOUT, FIND_CHILD ); + if( p_vout ) { - var_AddCallback( p_vout, "key-pressed", KeyEvent, p_intf ); + var_AddCallback( p_vout, "key-pressed", KeyEvent, p_intf ); } } - - + + /* Wait a bit */ msleep( INTF_IDLE_SLEEP ); } @@ -347,7 +347,7 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var, vlc_mutex_lock( &p_intf->change_lock ); p_intf->p_sys->b_key_pressed = VLC_TRUE; - + vlc_mutex_unlock( &p_intf->change_lock ); return VLC_SUCCESS; diff --git a/modules/access/vcdx/intf.h b/modules/access/vcdx/intf.h index 7ba5499ee7..90c04b0479 100644 --- a/modules/access/vcdx/intf.h +++ b/modules/access/vcdx/intf.h @@ -2,7 +2,7 @@ * intf.h: send info to intf. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: intf.h,v 1.3 2003/12/05 05:01:17 rocky Exp $ + * $Id: intf.h,v 1.4 2003/12/22 14:32:55 sam Exp $ * * Author: Stéphane Borel * @@ -10,7 +10,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. - * + * * This program 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 @@ -28,15 +28,15 @@ struct intf_sys_t { input_thread_t * p_input; thread_vcd_data_t * p_vcd; - + vlc_bool_t b_still; /* True if we are in a still frame */ vlc_bool_t b_inf_still; /* True if still wait time is infinite */ - mtime_t m_still_time; /* Time in microseconds remaining - to wait in still frame. - */ + mtime_t m_still_time; /* Time in microseconds remaining + to wait in still frame. + */ #if FINISHED vcdplay_ctrl_t control; -#else +#else int control; #endif vlc_bool_t b_click, b_move, b_key_pressed; diff --git a/modules/audio_filter/resampler/linear.c b/modules/audio_filter/resampler/linear.c index 12d335aa73..bdb7d44c0a 100644 --- a/modules/audio_filter/resampler/linear.c +++ b/modules/audio_filter/resampler/linear.c @@ -2,7 +2,7 @@ * linear.c : linear interpolation resampler ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: linear.c,v 1.10 2003/03/04 03:27:40 gbazin Exp $ + * $Id: linear.c,v 1.11 2003/12/22 14:32:55 sam Exp $ * * Authors: Gildas Bazin * Sigmund Augdal @@ -11,7 +11,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. - * + * * This program 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 @@ -129,15 +129,15 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, if( p_aout->mixer.mixer.i_rate == p_filter->input.i_rate ) { if( p_filter->b_continuity && - p_in_buf->i_size >= - p_in_buf->i_nb_bytes + sizeof(float) * i_nb_channels ) - { - /* output the whole thing with the last sample from last time */ - memmove( ((float *)(p_in_buf->p_buffer)) + i_nb_channels, - p_in_buf->p_buffer, p_in_buf->i_nb_bytes ); - memcpy( p_in_buf->p_buffer, p_prev_sample, - i_nb_channels * sizeof(float) ); - } + p_in_buf->i_size >= + p_in_buf->i_nb_bytes + sizeof(float) * i_nb_channels ) + { + /* output the whole thing with the last sample from last time */ + memmove( ((float *)(p_in_buf->p_buffer)) + i_nb_channels, + p_in_buf->p_buffer, p_in_buf->i_nb_bytes ); + memcpy( p_in_buf->p_buffer, p_prev_sample, + i_nb_channels * sizeof(float) ); + } p_filter->b_continuity = VLC_FALSE; return; } @@ -158,7 +158,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, if( !p_filter->b_continuity ) { p_filter->b_continuity = VLC_TRUE; - p_filter->p_sys->i_remainder = 0; + p_filter->p_sys->i_remainder = 0; aout_DateInit( &p_filter->p_sys->end_date, p_filter->output.i_rate ); } else @@ -169,12 +169,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, { i_chan--; p_out[i_chan] = p_prev_sample[i_chan]; - p_out[i_chan] += ( (p_prev_sample[i_chan] - p_in[i_chan]) - * p_filter->p_sys->i_remainder - / p_filter->output.i_rate ); + p_out[i_chan] += ( (p_prev_sample[i_chan] - p_in[i_chan]) + * p_filter->p_sys->i_remainder + / p_filter->output.i_rate ); } p_out += i_nb_channels; - i_out++; + i_out++; p_filter->p_sys->i_remainder += p_filter->input.i_rate; } @@ -190,12 +190,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, { i_chan--; p_out[i_chan] = p_in[i_chan]; - p_out[i_chan] += ( (p_in[i_chan] - - p_in[i_chan + i_nb_channels]) - * p_filter->p_sys->i_remainder / p_filter->output.i_rate ); + p_out[i_chan] += ( (p_in[i_chan] - + p_in[i_chan + i_nb_channels]) + * p_filter->p_sys->i_remainder / p_filter->output.i_rate ); } p_out += i_nb_channels; - i_out++; + i_out++; p_filter->p_sys->i_remainder += p_filter->input.i_rate; } @@ -215,7 +215,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, p_out_buf->start_date = p_in_buf->start_date; if( p_in_buf->start_date != - aout_DateGet( &p_filter->p_sys->end_date ) ) + aout_DateGet( &p_filter->p_sys->end_date ) ) { aout_DateSet( &p_filter->p_sys->end_date, p_in_buf->start_date ); } diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c index 5f864409b8..393a0438b4 100644 --- a/modules/audio_output/oss.c +++ b/modules/audio_output/oss.c @@ -2,10 +2,10 @@ * oss.c : OSS /dev/dsp module for vlc ***************************************************************************** * Copyright (C) 2000-2002 VideoLAN - * $Id: oss.c,v 1.60 2003/05/15 22:27:37 massiot Exp $ + * $Id: oss.c,v 1.61 2003/12/22 14:32:55 sam Exp $ * * Authors: Michel Kaempf - * Samuel Hocevar + * Sam Hocevar * Christophe Massiot * * This program is free software; you can redistribute it and/or modify @@ -55,7 +55,7 @@ /* Patches for ignorant OSS versions */ #ifndef AFMT_AC3 -# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */ +# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */ #endif #ifndef AFMT_S16_NE @@ -253,7 +253,7 @@ static void Probe( aout_instance_t * p_aout ) { msg_Warn( p_aout, "s/pdif not supported by card" ); } - } + } var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL ); diff --git a/modules/audio_output/sdl.c b/modules/audio_output/sdl.c index 7695bfd353..b70b6896a7 100644 --- a/modules/audio_output/sdl.c +++ b/modules/audio_output/sdl.c @@ -2,10 +2,10 @@ * sdl.c : SDL audio output plugin for vlc ***************************************************************************** * Copyright (C) 2000-2002 VideoLAN - * $Id: sdl.c,v 1.23 2003/10/25 00:49:13 sam Exp $ + * $Id: sdl.c,v 1.24 2003/12/22 14:32:55 sam Exp $ * * Authors: Michel Kaempf - * Samuel Hocevar + * Sam Hocevar * Pierre Baillet * Christophe Massiot * @@ -177,7 +177,7 @@ static int Open ( vlc_object_t *p_this ) var_Change( p_aout, "audio-device", VLC_VAR_SETTEXT, &text, NULL ); val.i_int = (obtained.channels == 2) ? AOUT_VAR_STEREO : - AOUT_VAR_MONO; + AOUT_VAR_MONO; text.psz_string = (obtained.channels == 2) ? N_("Stereo") : N_("Mono"); var_Change( p_aout, "audio-device", diff --git a/modules/codec/a52.c b/modules/codec/a52.c index a1386fd187..f4f7a08af3 100644 --- a/modules/codec/a52.c +++ b/modules/codec/a52.c @@ -2,7 +2,7 @@ * a52.c: parse A/52 audio sync info and packetize the stream ***************************************************************************** * Copyright (C) 2001-2002 VideoLAN - * $Id: a52.c,v 1.31 2003/11/22 23:39:14 fenrir Exp $ + * $Id: a52.c,v 1.32 2003/12/22 14:32:55 sam Exp $ * * Authors: Stéphane Borel * Christophe Massiot @@ -195,7 +195,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) } if( p_sys->i_state != STATE_SYNC ) { - block_BytestreamFlush( &p_sys->bytestream ); + block_BytestreamFlush( &p_sys->bytestream ); /* Need more data */ return NULL; diff --git a/modules/codec/dts.c b/modules/codec/dts.c index 99303156e3..4524de8158 100644 --- a/modules/codec/dts.c +++ b/modules/codec/dts.c @@ -2,7 +2,7 @@ * dts.c: parse DTS audio sync info and packetize the stream ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: dts.c,v 1.8 2003/12/01 23:39:11 gbazin Exp $ + * $Id: dts.c,v 1.9 2003/12/22 14:32:55 sam Exp $ * * Authors: Jon Lech Johansen * Gildas Bazin @@ -263,7 +263,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) { msg_Dbg( p_dec, "emulated sync word " "(no sync on following frame) %2.2x%2.2x%2.2x%2.2x", - p_header[0], p_header[1], p_header[2], p_header[3] ); + p_header[0], p_header[1], p_header[2], p_header[3] ); p_sys->i_state = STATE_NOSYNC; block_SkipByte( &p_sys->bytestream ); break; @@ -546,7 +546,7 @@ static int SyncInfo( const byte_t * p_buf, { /* User defined */ *pi_channels = 0; - *pi_channels_conf = 0; + *pi_channels_conf = 0; } else { diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c index 9791b7165f..e63a3b57f4 100755 --- a/modules/codec/libmpeg2.c +++ b/modules/codec/libmpeg2.c @@ -2,7 +2,7 @@ * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: libmpeg2.c,v 1.38 2003/12/10 23:27:34 gbazin Exp $ + * $Id: libmpeg2.c,v 1.39 2003/12/22 14:32:55 sam Exp $ * * Authors: Gildas Bazin * Christophe Massiot @@ -220,7 +220,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) mpeg2_buffer( p_sys->p_mpeg2dec, p_block->p_buffer, p_block->p_buffer + p_block->i_buffer ); - p_block->i_buffer = 0; + p_block->i_buffer = 0; break; case STATE_SEQUENCE: @@ -256,7 +256,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) { /* Use the value provided in the MPEG sequence header */ p_sys->i_aspect = - ((uint64_t)p_sys->p_info->sequence->display_width) * + ((uint64_t)p_sys->p_info->sequence->display_width) * p_sys->p_info->sequence->pixel_width * VOUT_ASPECT_FACTOR / p_sys->p_info->sequence->display_height / p_sys->p_info->sequence->pixel_height; @@ -276,10 +276,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) mpeg2_set_buf( p_sys->p_mpeg2dec, buf, NULL ); if( (p_pic = GetNewPicture( p_dec, buf )) == NULL ) - { - block_Release( p_block ); - return NULL; - } + { + block_Release( p_block ); + return NULL; + } mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic ); @@ -357,7 +357,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) vout_SynchroNewPicture( p_sys->p_synchro, p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, - p_sys->p_info->current_picture->nb_fields, i_pts, + p_sys->p_info->current_picture->nb_fields, i_pts, 0, p_sys->i_current_rate ); if ( !(p_sys->b_slice_i @@ -366,7 +366,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) && !vout_SynchroChoose( p_sys->p_synchro, p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, - /*p_sys->p_vout->render_time*/ 0 /*FIXME*/ ) ) + /*p_sys->p_vout->render_time*/ 0 /*FIXME*/ ) ) { mpeg2_skip( p_sys->p_mpeg2dec, 1 ); p_sys->b_skip = 1; @@ -380,10 +380,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) vout_SynchroDecode( p_sys->p_synchro ); if( (p_pic = GetNewPicture( p_dec, buf )) == NULL ) - { - block_Release( p_block ); - return NULL; - } + { + block_Release( p_block ); + return NULL; + } mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic ); } @@ -422,7 +422,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_sys->p_info->discard_fbuf->id ); } - if( p_pic ) return p_pic; + if( p_pic ) return p_pic; break; @@ -434,7 +434,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) msg_Warn( p_dec, "invalid picture encountered" ); if ( ( p_sys->p_info->current_picture == NULL ) || ( ( p_sys->p_info->current_picture->flags & - PIC_MASK_CODING_TYPE) != B_CODING_TYPE ) ) + PIC_MASK_CODING_TYPE) != B_CODING_TYPE ) ) { if( p_sys->p_synchro ) vout_SynchroReset( p_sys->p_synchro ); } diff --git a/modules/codec/ogt/ogt.h b/modules/codec/ogt/ogt.h index 33a679d7fc..358f138839 100644 --- a/modules/codec/ogt/ogt.h +++ b/modules/codec/ogt/ogt.h @@ -2,18 +2,18 @@ * ogt.h : Overlay Graphics Text (SVCD subtitles) decoder thread interface ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: ogt.h,v 1.2 2003/12/08 06:01:11 rocky Exp $ + * $Id: ogt.h,v 1.3 2003/12/22 14:32:55 sam Exp $ * - * Authors: Rocky Bernstein - * based on code from: + * Author: Rocky Bernstein + * based on code from: * Julio Sanchez Fernandez (http://subhandler.sourceforge.net) - * Samuel Hocevar + * Sam Hocevar * * This program 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. - * + * * This program 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 @@ #define DECODE_DBG_EXT 1 /* Calls from external routines */ #define DECODE_DBG_CALL 2 /* all calls */ #define DECODE_DBG_PACKET 4 /* packet assembly info */ -#define DECODE_DBG_INFO 8 +#define DECODE_DBG_INFO 8 #define DECODE_DEBUG 1 #if DECODE_DEBUG @@ -35,16 +35,16 @@ if (p_sys && p_sys->i_debug & mask) \ msg_Dbg(p_dec, "%s: "s, __func__ , ##args) #else -#define dbg_print(mask, s, args...) +#define dbg_print(mask, s, args...) #endif #define LOG_ERR(args...) msg_Err( p_input, args ) #define LOG_WARN(args...) msg_Warn( p_input, args ) #define GETINT16(p) ( (p[0] << 8) + p[1] ); p +=2; - -#define GETINT32(p) ( (p[0] << 24) + (p[1] << 16) + \ - (p[2] << 8) + (p[3]) ) ; p += 4; + +#define GETINT32(p) ( (p[0] << 24) + (p[1] << 16) + \ + (p[2] << 8) + (p[3]) ) ; p += 4; typedef enum { SUBTITLE_BLOCK_EMPTY, @@ -54,10 +54,10 @@ typedef enum { /* Color and transparency of a pixel or a palette (CLUT) entry */ typedef struct ogt_yuvt_val_s { - u_int8_t y; - u_int8_t u; - u_int8_t v; - u_int8_t t; + uint8_t y; + uint8_t u; + uint8_t v; + uint8_t t; } ogt_yuvt_val_t; struct decoder_sys_t @@ -65,49 +65,49 @@ struct decoder_sys_t int i_debug; /* debugging mask */ int b_packetizer; - + mtime_t i_pts; /* Start PTS of subtitle block */ - int i_spu_size; /* size of the allocated subtitle_data */ + int i_spu_size; /* size of the allocated subtitle_data */ int i_spu; packet_state_t state; /* data-gathering state for this subtitle */ - u_int16_t i_image; /* image number in the subtitle stream; 0 is the - first one. */ - u_int8_t i_packet; /* packet number for above image number; 0 is the - first one. */ - + uint16_t i_image; /* image number in the subtitle stream; 0 is the + first one. */ + uint8_t i_packet; /* packet number for above image number; 0 is the + first one. */ + block_t *p_block; /* Bytes of the packet. */ - + uint8_t buffer[65536 + 20 ]; /* we will never overflow more than 11 bytes if I'm right */ vout_thread_t *p_vout; /* Move into subpicture_sys_t? */ - u_int16_t comp_image_offset; /* offset from subtitle_data to compressed - image data */ - int comp_image_length; /* size of the compressed image data */ + uint16_t comp_image_offset; /* offset from subtitle_data to compressed + image data */ + int comp_image_length; /* size of the compressed image data */ int first_field_offset; int second_field_offset; - int metadata_offset; /* offset to data describing the image */ - int metadata_length; /* length of metadata */ + int metadata_offset; /* offset to data describing the image */ + int metadata_length; /* length of metadata */ - int subtitle_data_pos; /* where to write next chunk */ - int subtitle_data_length; /* goal for subtitle_data_pos while gathering, - length of used subtitle_data later */ + int subtitle_data_pos; /* where to write next chunk */ + int subtitle_data_length; /* goal for subtitle_data_pos while gathering, + length of used subtitle_data later */ - u_int32_t i_duration; /* how long to display the image, 0 stands - for "until next subtitle" */ + uint32_t i_duration; /* how long to display the image, 0 stands + for "until next subtitle" */ - u_int16_t i_x_start, i_y_start; /* position of top leftmost pixel of - image when displayed */ - u_int16_t i_width, i_height; /* dimensions in pixels of image */ + uint16_t i_x_start, i_y_start; /* position of top leftmost pixel of + image when displayed */ + uint16_t i_width, i_height; /* dimensions in pixels of image */ ogt_yuvt_val_t pi_palette[4]; - u_int8_t i_options; - u_int8_t i_options2; - u_int8_t i_cmd; - u_int32_t i_cmd_arg; + uint8_t i_options; + uint8_t i_options2; + uint8_t i_cmd; + uint32_t i_cmd_arg; }; struct subpicture_sys_t diff --git a/modules/control/lirc/lirc.c b/modules/control/lirc/lirc.c index 0b1cf98da4..6262f86960 100644 --- a/modules/control/lirc/lirc.c +++ b/modules/control/lirc/lirc.c @@ -2,15 +2,15 @@ * lirc.c : lirc plugin for vlc ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: lirc.c,v 1.8 2003/08/14 18:12:39 sigmunau Exp $ + * $Id: lirc.c,v 1.9 2003/12/22 14:32:55 sam Exp $ * - * Authors: Sigmund Augdal + * Author: Sigmund Augdal * * This program 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. - * + * * This program 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 @@ -138,7 +138,7 @@ static void Run( intf_thread_t *p_intf ) playlist_t *p_playlist; input_thread_t *p_input; vout_thread_t *p_vout = NULL; - + while( !p_intf->b_die ) { /* Sleep a bit */ @@ -182,11 +182,11 @@ static void Run( intf_thread_t *p_intf ) continue; } - while( !p_intf->b_die + while( !p_intf->b_die && lirc_code2char( p_intf->p_sys->config, code, &c ) == 0 && c != NULL ) { - + if( !strcmp( c, "QUIT" ) ) { p_intf->p_vlc->b_die = VLC_TRUE; @@ -271,7 +271,7 @@ static void Run( intf_thread_t *p_intf ) continue; } } - + if( !strcmp( c, "PLAY" ) ) { p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, @@ -288,7 +288,7 @@ static void Run( intf_thread_t *p_intf ) } continue; } - + if( !strcmp( c, "PLAYPAUSE" ) ) { if( p_input && @@ -312,10 +312,10 @@ static void Run( intf_thread_t *p_intf ) vlc_object_release( p_playlist ); } } - } + } continue; } - + else if( p_input ) { if( !strcmp( c, "PAUSE" ) ) @@ -362,11 +362,11 @@ static void Run( intf_thread_t *p_intf ) input_SetStatus( p_input, INPUT_STATUS_SLOWER ); } /* beginning of modifications by stephane Thu Jun 19 15:29:49 CEST 2003 */ - else if ( !strcmp(c, "CHAPTER_N" ) || + else if ( !strcmp(c, "CHAPTER_N" ) || !strcmp( c, "CHAPTER_P" ) ) { unsigned int i_chapter = 0; - + if( !strcmp( c, "CHAPTER_N" ) ) { vlc_mutex_lock( &p_input->stream.stream_lock ); @@ -379,7 +379,7 @@ static void Run( intf_thread_t *p_intf ) i_chapter = p_input->stream.p_selected_area->i_part - 1; vlc_mutex_unlock( &p_input->stream.stream_lock ); } - + vlc_mutex_lock( &p_input->stream.stream_lock ); if( ( i_chapter > 0 ) && ( i_chapter < p_input->stream.p_selected_area->i_part_nb ) ) @@ -392,7 +392,7 @@ static void Run( intf_thread_t *p_intf ) vlc_mutex_lock( &p_input->stream.stream_lock ); } vlc_mutex_unlock( &p_input->stream.stream_lock ); - } + } /* end of modification by stephane Thu Jun 19 15:29:49 CEST 2003 */ } } @@ -405,7 +405,7 @@ static void Feedback( intf_thread_t *p_intf, char *psz_string ) { if ( p_intf->p_sys->p_vout ) { - vout_ShowTextRelative( p_intf->p_sys->p_vout, psz_string, NULL, - OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,400000 ); + vout_ShowTextRelative( p_intf->p_sys->p_vout, psz_string, NULL, + OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,400000 ); } } diff --git a/modules/control/rc/rc.c b/modules/control/rc/rc.c index 51e898e49e..e0dad7ad61 100644 --- a/modules/control/rc/rc.c +++ b/modules/control/rc/rc.c @@ -2,15 +2,15 @@ * rc.c : remote control stdin/stdout plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: rc.c,v 1.39 2003/12/02 13:31:23 gbazin Exp $ + * $Id: rc.c,v 1.40 2003/12/22 14:32:55 sam Exp $ * - * Authors: Peter Surda + * Author: Peter Surda * * This program 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. - * + * * This program 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 @@ -201,7 +201,7 @@ static void Run( intf_thread_t *p_intf ) hConsoleIn = GetStdHandle(STD_INPUT_HANDLE); if( hConsoleIn == INVALID_HANDLE_VALUE ) { - msg_Err( p_intf, "Couldn't open STD_INPUT_HANDLE" ); + msg_Err( p_intf, "Couldn't open STD_INPUT_HANDLE" ); p_intf->b_die = VLC_TRUE; } #endif @@ -823,10 +823,10 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd, { if ( i_value == val.p_list->p_values[i].i_int ) printf( "| %i - %s *\n", val.p_list->p_values[i].i_int, - text.p_list->p_values[i].psz_string ); + text.p_list->p_values[i].psz_string ); else printf( "| %i - %s\n", val.p_list->p_values[i].i_int, - text.p_list->p_values[i].psz_string ); + text.p_list->p_values[i].psz_string ); } var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST, &val, &text ); diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c index 6b94aef0e8..06b6ffe655 100644 --- a/modules/demux/mp4/libmp4.c +++ b/modules/demux/mp4/libmp4.c @@ -2,8 +2,9 @@ * libmp4.c : LibMP4 library for mp4 module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: libmp4.c,v 1.38 2003/12/15 22:55:01 gbazin Exp $ - * Authors: Laurent Aimar + * $Id: libmp4.c,v 1.39 2003/12/22 14:32:55 sam Exp $ + * + * Author: Laurent Aimar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -985,7 +986,7 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) #ifdef MP4_VERBOSE msg_Dbg( p_stream->p_input, "Found esds MPEG4ESDescr (%dBytes)", - i_len ); + i_len ); #endif MP4_GET2BYTES( es_descriptor.i_ES_ID ); @@ -1031,7 +1032,7 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) #ifdef MP4_VERBOSE msg_Dbg( p_stream->p_input, "Found esds MP4DecConfigDescr (%dBytes)", - i_len ); + i_len ); #endif es_descriptor.p_decConfigDescr = @@ -1056,7 +1057,7 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) #ifdef MP4_VERBOSE msg_Dbg( p_stream->p_input, "Found esds MP4DecSpecificDescr (%dBytes)", - i_len ); + i_len ); #endif es_descriptor.p_decConfigDescr->i_decoder_specific_info_len = i_len; diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c index a336b4a563..f0d820aa2e 100644 --- a/modules/demux/mpeg/ps.c +++ b/modules/demux/mpeg/ps.c @@ -2,15 +2,15 @@ * ps.c : Program Stream input module for vlc ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: ps.c,v 1.12 2003/10/27 18:57:12 rocky Exp $ + * $Id: ps.c,v 1.13 2003/12/22 14:32:56 sam Exp $ * - * Authors: Christophe Massiot + * Author: Christophe Massiot * * This program 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. - * + * * This program 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 @@ -137,16 +137,16 @@ static int Activate( vlc_object_t * p_this ) return -1; } input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); - - p_input->stream.p_selected_program = + + p_input->stream.p_selected_program = p_input->stream.pp_programs[0] ; - + if( p_input->stream.b_seekable ) { stream_ps_data_t * p_demux_data = (stream_ps_data_t *)p_input->stream.pp_programs[0]->p_demux_data; - off_t i_tell = p_input->stream.p_selected_area->i_tell; + off_t i_tell = p_input->stream.p_selected_area->i_tell; /* Pre-parse the stream to gather stream_descriptor_t. */ p_input->pf_seek( p_input, (off_t) 0 ); diff --git a/modules/demux/mpeg/system.c b/modules/demux/mpeg/system.c index 89bec6f2ab..810af40b7f 100644 --- a/modules/demux/mpeg/system.c +++ b/modules/demux/mpeg/system.c @@ -2,12 +2,12 @@ * system.c: helper module for TS, PS and PES management ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: system.c,v 1.25 2003/12/07 01:02:08 rocky Exp $ + * $Id: system.c,v 1.26 2003/12/22 14:32:56 sam Exp $ * * Authors: Christophe Massiot * Michel Lespinasse * Benoît Steiner - * Samuel Hocevar + * Sam Hocevar * Henri Fallon * * This program is free software; you can redistribute it and/or modify @@ -968,7 +968,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input, else if( (i_id & 0xFFFF) == 0x70BD ) { /* SVCD OGT subtitles in stream 0x070 */ - i_fourcc = VLC_FOURCC('o','g','t', ' '); + i_fourcc = VLC_FOURCC('o','g','t', ' '); i_cat = SPU_ES; #ifdef FINISHED_DEBUGGING if( !p_input->stream.b_seekable ) @@ -979,14 +979,14 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input, b_auto_spawn = VLC_TRUE; } } - else if( ((i_id >> 8) & 0xFF) <= 0x03 && - (i_id & 0x00FF) == 0x00BD ) + else if( ((i_id >> 8) & 0xFF) <= 0x03 && + (i_id & 0x00FF) == 0x00BD ) { /* CVD subtitles (0x00->0x03) */ - i_fourcc = VLC_FOURCC('c','v','d', ' '); + i_fourcc = VLC_FOURCC('c','v','d', ' '); i_cat = SPU_ES; - msg_Warn( p_input, - "CVD subtitles not implemented yet" ); + msg_Warn( p_input, + "CVD subtitles not implemented yet" ); } else { diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c index d01eae8ab8..eca46ae4fc 100644 --- a/modules/demux/ogg.c +++ b/modules/demux/ogg.c @@ -2,9 +2,9 @@ * ogg.c : ogg stream input module for vlc ***************************************************************************** * Copyright (C) 2001-2003 VideoLAN - * $Id: ogg.c,v 1.51 2003/12/16 12:38:18 gbazin Exp $ + * $Id: ogg.c,v 1.52 2003/12/22 14:32:55 sam Exp $ * - * Authors: Gildas Bazin + * Author: Gildas Bazin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1235,8 +1235,8 @@ static int Demux( input_thread_t * p_input ) else { input_ClockManageRef( p_input, - p_input->stream.p_selected_program, - p_stream->i_pcr ); + p_input->stream.p_selected_program, + p_stream->i_pcr ); } continue; } diff --git a/modules/gui/gtk/gtk_callbacks.c b/modules/gui/gtk/gtk_callbacks.c index 1403ee95be..407210f244 100644 --- a/modules/gui/gtk/gtk_callbacks.c +++ b/modules/gui/gtk/gtk_callbacks.c @@ -2,9 +2,9 @@ * gtk_callbacks.c : Callbacks for the Gtk+ plugin. ***************************************************************************** * Copyright (C) 2000, 2001, 2003 VideoLAN - * $Id: gtk_callbacks.c,v 1.15 2003/12/12 03:01:12 rocky Exp $ + * $Id: gtk_callbacks.c,v 1.16 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * Stéphane Borel * Julien BLACHE * @@ -48,7 +48,7 @@ #ifdef HAVE_CDDAX #define CDDA_MRL "cddax://" -#else +#else #define CDDA_MRL "cdda://" #endif @@ -461,7 +461,7 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data ) { if( !strncmp(psz_current, "dvd://", 4) ) { - switch( psz_current[strlen("dvd://")] ) + switch( psz_current[strlen("dvd://")] ) { case '\0': case '@': @@ -469,13 +469,13 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data ) break; default: /* Omit the first MRL-selector characters */ - psz_device = strdup( psz_current + strlen("dvd://" ) ); + psz_device = strdup( psz_current + strlen("dvd://" ) ); break; } } else if( !strncmp(psz_current, "vcd:", strlen("vcd:")) ) { - switch( psz_current[strlen("vcd:")] ) + switch( psz_current[strlen("vcd:")] ) { case '\0': case '@': @@ -483,13 +483,13 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data ) break; default: /* Omit the beginning MRL-selector characters */ - psz_device = strdup( psz_current + strlen(VCD_MRL) ); + psz_device = strdup( psz_current + strlen(VCD_MRL) ); break; } } - else if( !strncmp(psz_current, CDDA_MRL, strlen(CDDA_MRL) ) ) + else if( !strncmp(psz_current, CDDA_MRL, strlen(CDDA_MRL) ) ) { - switch( psz_current[strlen(CDDA_MRL)] ) + switch( psz_current[strlen(CDDA_MRL)] ) { case '\0': case '@': @@ -497,7 +497,7 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data ) break; default: /* Omit the beginning MRL-selector characters */ - psz_device = strdup( psz_current + strlen(CDDA_MRL) ); + psz_device = strdup( psz_current + strlen(CDDA_MRL) ); break; } } @@ -636,8 +636,6 @@ GtkMenubarDeinterlace ( GtkMenuItem *menuitem, if( p_intf ) msg_Dbg( p_intf, "GtkMenubarDeinterlace" ); - - } diff --git a/modules/gui/gtk/menu.c b/modules/gui/gtk/menu.c index 5fdd69fd42..d18d0a6df8 100644 --- a/modules/gui/gtk/menu.c +++ b/modules/gui/gtk/menu.c @@ -2,9 +2,9 @@ * menu.c : functions to handle menu items. ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: menu.c,v 1.12 2003/11/24 00:39:01 fenrir Exp $ + * $Id: menu.c,v 1.13 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * Stéphane Borel * Johan Bilien * Laurent Aimar @@ -411,19 +411,19 @@ static void GtkDeinterlaceUpdate( intf_thread_t *p_intf, char *psz_mode ) if( strcmp( psz_mode, "None" ) ) { vout_thread_t *p_vout; - p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, - FIND_ANYWHERE ); - if( p_vout ) - { - vlc_value_t val; - - val.psz_string = psz_mode; - if( var_Set( p_vout, "deinterlace-mode", val ) != VLC_SUCCESS ) + p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, + FIND_ANYWHERE ); + if( p_vout ) + { + vlc_value_t val; + + val.psz_string = psz_mode; + if( var_Set( p_vout, "deinterlace-mode", val ) != VLC_SUCCESS ) config_PutPsz( p_intf, "deinterlace-mode", psz_mode ); - vlc_object_release( p_vout ); - } - else + vlc_object_release( p_vout ); + } + else config_PutPsz( p_intf, "deinterlace-mode", psz_mode ); } @@ -1167,7 +1167,7 @@ static gint GtkSetupVarMenu( intf_thread_t * p_intf, break; default: /* FIXME */ - return FALSE; + return FALSE; } p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) ); diff --git a/modules/gui/gtk/open.c b/modules/gui/gtk/open.c index a126436290..74baf51271 100644 --- a/modules/gui/gtk/open.c +++ b/modules/gui/gtk/open.c @@ -2,9 +2,9 @@ * gtk_open.c : functions to handle file/disc/network open widgets. ***************************************************************************** * Copyright (C) 2000, 2001, 2003 VideoLAN - * $Id: open.c,v 1.21 2003/12/13 00:53:50 rocky Exp $ + * $Id: open.c,v 1.22 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * Stéphane Borel * * This program is free software; you can redistribute it and/or modify @@ -48,7 +48,7 @@ #ifdef HAVE_CDDAX #define CDDA_MRL "cddax://" -#else +#else #define CDDA_MRL "cdda://" #endif @@ -153,26 +153,26 @@ void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data ) intf_thread_t * p_intf = GtkGetIntf( togglebutton ); char *psz_device; - if( togglebutton->active ) + if( togglebutton->active ) { - if ( (psz_device = config_GetPsz( p_intf, "dvd" )) ) + if ( (psz_device = config_GetPsz( p_intf, "dvd" )) ) { - gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ) , TRUE); + gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ) , TRUE); - gtk_entry_set_text( + gtk_entry_set_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), psz_device ); - free( psz_device ); - } - else - { - gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE ); - } - GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); + free( psz_device ); + } + else + { + gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE ); + } + GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); } else { - gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE ); + gtk_widget_set_sensitive( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_open ), "disc_dvd_use_menu" ) ), FALSE ); } } @@ -181,20 +181,20 @@ void GtkDiscOpenVcd( GtkToggleButton * togglebutton, gpointer user_data ) intf_thread_t * p_intf = GtkGetIntf( togglebutton ); char *psz_device; - if( togglebutton->active ) + if( togglebutton->active ) { - if ( (psz_device = config_GetPsz( p_intf, "vcd" )) ) - { - gtk_entry_set_text( + if ( (psz_device = config_GetPsz( p_intf, "vcd" )) ) + { + gtk_entry_set_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), psz_device ); - free( psz_device ); - } else { + free( psz_device ); + } else { gtk_entry_set_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), "" ); - } - GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); + } + GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); } } @@ -203,20 +203,20 @@ void GtkDiscOpenCDDA( GtkToggleButton * togglebutton, gpointer user_data ) intf_thread_t * p_intf = GtkGetIntf( togglebutton ); char *psz_device; - if( togglebutton->active ) + if( togglebutton->active ) { - if ( (psz_device = config_GetPsz( p_intf, "cd-audio" )) ) + if ( (psz_device = config_GetPsz( p_intf, "cd-audio" )) ) { gtk_entry_set_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), psz_device ); free( psz_device ); - } else { + } else { gtk_entry_set_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ), "" ); - } - GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); + } + GtkDiscOpenChanged( (GtkWidget *) togglebutton, user_data ); } } @@ -228,12 +228,12 @@ static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data ) vlc_bool_t b_menus = VLC_FALSE; vlc_bool_t b_chapter_menu = VLC_TRUE; GtkWidget *p_label = gtk_object_get_data( GTK_OBJECT( p_open ), - "disc_title_label" ); + "disc_title_label" ); if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_dvd" ) )->active ) { - gtk_label_set_text( GTK_LABEL( p_label ), _("Title") ); + gtk_label_set_text( GTK_LABEL( p_label ), _("Title") ); b_menus = GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_dvd_use_menu" ) )->active; @@ -246,45 +246,45 @@ static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data ) { g_string_append( p_target, "dvdsimple://" ); } - - g_string_append( p_target, - gtk_entry_get_text( GTK_ENTRY( lookup_widget( + + g_string_append( p_target, + gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(button), "disc_name" ) ) ) ); - if( !b_menus ) - { - g_string_sprintfa( p_target, "@%i:%i", - gtk_spin_button_get_value_as_int( + if( !b_menus ) + { + g_string_sprintfa( p_target, "@%i:%i", + gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_title" ) ) ), gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_chapter" ) ) ) ); - } + } } else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), "disc_vcd" ) )->active ) { int i = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget( - GTK_WIDGET(button), "disc_title" ) ) ); + GTK_WIDGET(button), "disc_title" ) ) ); #ifdef HAVE_VCDX - int i_pbc = config_GetInt( p_intf, "vcdx-PBC" ); + int i_pbc = config_GetInt( p_intf, "vcdx-PBC" ); + + gtk_label_set_text( GTK_LABEL( p_label ), + i_pbc ? _("PBC LID") : _("Entry") ); - gtk_label_set_text( GTK_LABEL( p_label ), - i_pbc ? _("PBC LID") : _("Entry") ); - g_string_append( p_target, VCD_MRL ); - g_string_append( p_target, - gtk_entry_get_text( GTK_ENTRY( lookup_widget( + g_string_append( p_target, + gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(button), "disc_name" ) ) ) ); - if ( i ) - g_string_sprintfa( p_target, "@%c%d", i_pbc ? 'P' : 'E', i ); - + if ( i ) + g_string_sprintfa( p_target, "@%c%d", i_pbc ? 'P' : 'E', i ); + #else - gtk_label_set_text( GTK_LABEL( p_label ), _("Track") ); + gtk_label_set_text( GTK_LABEL( p_label ), _("Track") ); g_string_append( p_target, VCD_MRL ); g_string_sprintfa( p_target, "@%d", i ); #endif /* HAVE_VCDX */ @@ -296,18 +296,18 @@ static void GtkDiscOpenChanged( GtkWidget * button, gpointer user_data ) { int i = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( lookup_widget( - GTK_WIDGET(button), "disc_title" ) ) ); + GTK_WIDGET(button), "disc_title" ) ) ); - gtk_label_set_text( GTK_LABEL( p_label ), _("Track") ); + gtk_label_set_text( GTK_LABEL( p_label ), _("Track") ); b_chapter_menu = VLC_FALSE; g_string_append( p_target, CDDA_MRL ); - g_string_append( p_target, + g_string_append( p_target, gtk_entry_get_text( GTK_ENTRY( lookup_widget( GTK_WIDGET(button), "disc_name" ) ) ) ); #ifdef HAVE_CDDAX - if ( i ) - g_string_sprintfa( p_target, "@T%i", i ); + if ( i ) + g_string_sprintfa( p_target, "@T%i", i ); #else g_string_sprintfa( p_target, "@%i", i ); diff --git a/modules/gui/gtk/playlist.c b/modules/gui/gtk/playlist.c index 13f1c8120c..ba32c380f9 100644 --- a/modules/gui/gtk/playlist.c +++ b/modules/gui/gtk/playlist.c @@ -2,7 +2,7 @@ * gtk_playlist.c : Interface for the playlist dialog ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: playlist.c,v 1.7 2003/12/03 21:58:43 sigmunau Exp $ + * $Id: playlist.c,v 1.8 2003/12/22 14:32:56 sam Exp $ * * Authors: Pierre Baillet * Stéphane Borel @@ -698,7 +698,7 @@ void GtkRebuildCList( GtkCList * p_clist, playlist_t * p_playlist ) mtime_t dur = p_playlist->pp_items[i_dummy]->i_duration; if ( dur != -1 ) { - secstotimestr( psz_duration, dur/1000000 ); + secstotimestr( psz_duration, dur/1000000 ); } else { diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 37acdeec06..7aa5f26394 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -2,7 +2,7 @@ * intf.h: MacOS X interface plugin ***************************************************************************** * Copyright (C) 2002-2003 VideoLAN - * $Id: intf.h,v 1.52 2003/12/15 19:25:56 bigben Exp $ + * $Id: intf.h,v 1.53 2003/12/22 14:32:56 sam Exp $ * * Authors: Jon Lech Johansen * Christophe Massiot @@ -12,7 +12,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. - * + * * This program 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 @@ -31,7 +31,7 @@ #include /***************************************************************************** - * VLCApplication interface + * VLCApplication interface *****************************************************************************/ @interface VLCApplication : NSApplication { @@ -87,7 +87,7 @@ struct intf_sys_t }; /***************************************************************************** - * VLCMain interface + * VLCMain interface *****************************************************************************/ @interface VLCMain : NSObject { @@ -98,7 +98,7 @@ struct intf_sys_t IBOutlet id o_timefield; /* time field */ IBOutlet id o_timeslider; /* time slider */ float f_slider; /* slider value */ - float f_slider_old; /* old slider val */ + float f_slider_old; /* old slider val */ IBOutlet id o_volumeslider; /* volume slider */ IBOutlet id o_btn_prev; /* btn previous */ @@ -116,13 +116,13 @@ struct intf_sys_t IBOutlet id o_controls; /* VLCControls */ IBOutlet id o_playlist; /* VLCPlaylist */ - IBOutlet id o_info; /* VLCInfo */ + IBOutlet id o_info; /* VLCInfo */ IBOutlet id o_messages; /* messages tv */ IBOutlet id o_msgs_panel; /* messages panel */ NSMutableArray * o_msg_arr; /* messages array */ NSLock * o_msg_lock; /* messages lock */ - IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */ + IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */ IBOutlet id o_error; /* error panel */ IBOutlet id o_err_msg; /* NSTextView */ @@ -130,8 +130,8 @@ struct intf_sys_t IBOutlet id o_err_bug_lbl; IBOutlet id o_err_btn_msgs; /* Open Messages */ IBOutlet id o_err_btn_dismiss; - - IBOutlet id o_info_window; /* Info panel */ + + IBOutlet id o_info_window; /* Info panel */ /* main menu */ @@ -213,7 +213,7 @@ struct intf_sys_t IBOutlet id o_mi_info; IBOutlet id o_mi_messages; IBOutlet id o_mi_bring_atf; - + IBOutlet id o_mu_help; IBOutlet id o_mi_readme; IBOutlet id o_mi_documentation; diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m index 540d5f30b8..3d2b807afa 100644 --- a/modules/gui/macosx/prefs.m +++ b/modules/gui/macosx/prefs.m @@ -2,10 +2,10 @@ * prefs.m: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2002-2003 VideoLAN - * $Id: prefs.m,v 1.35 2003/11/11 23:50:41 hartman Exp $ + * $Id: prefs.m,v 1.36 2003/12/22 14:32:56 sam Exp $ * - * Authors: Jon Lech Johansen - * Derk-Jan Hartman + * Authors: Jon Lech Johansen + * Derk-Jan Hartman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/modules/gui/ncurses/ncurses.c b/modules/gui/ncurses/ncurses.c index 315e757bad..378e008bb7 100644 --- a/modules/gui/ncurses/ncurses.c +++ b/modules/gui/ncurses/ncurses.c @@ -2,9 +2,9 @@ * ncurses.c : NCurses plugin for vlc ***************************************************************************** * Copyright (C) 2001, 2002, 2003 VideoLAN - * $Id: ncurses.c,v 1.5 2003/12/12 03:06:51 rocky Exp $ + * $Id: ncurses.c,v 1.6 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ #ifdef HAVE_CDDAX #define CDDA_MRL "cddax://" -#else +#else #define CDDA_MRL "cdda://" #endif @@ -403,7 +403,7 @@ static void Eject ( intf_thread_t *p_intf ) { if( !strncmp(psz_name, "dvd://", 4) ) { - switch( psz_name[strlen("dvd://")] ) + switch( psz_name[strlen("dvd://")] ) { case '\0': case '@': @@ -411,13 +411,13 @@ static void Eject ( intf_thread_t *p_intf ) break; default: /* Omit the first MRL-selector characters */ - psz_device = strdup( psz_name + strlen("dvd://" ) ); + psz_device = strdup( psz_name + strlen("dvd://" ) ); break; } } else if( !strncmp(psz_name, VCD_MRL, strlen(VCD_MRL)) ) { - switch( psz_name[strlen(VCD_MRL)] ) + switch( psz_name[strlen(VCD_MRL)] ) { case '\0': case '@': @@ -425,13 +425,13 @@ static void Eject ( intf_thread_t *p_intf ) break; default: /* Omit the beginning MRL-selector characters */ - psz_device = strdup( psz_name + strlen(VCD_MRL) ); + psz_device = strdup( psz_name + strlen(VCD_MRL) ); break; } } - else if( !strncmp(psz_name, CDDA_MRL, strlen(CDDA_MRL) ) ) + else if( !strncmp(psz_name, CDDA_MRL, strlen(CDDA_MRL) ) ) { - switch( psz_name[strlen(CDDA_MRL)] ) + switch( psz_name[strlen(CDDA_MRL)] ) { case '\0': case '@': @@ -439,7 +439,7 @@ static void Eject ( intf_thread_t *p_intf ) break; default: /* Omit the beginning MRL-selector characters */ - psz_device = strdup( psz_name + strlen(CDDA_MRL) ); + psz_device = strdup( psz_name + strlen(CDDA_MRL) ); break; } } diff --git a/modules/gui/pda/pda.c b/modules/gui/pda/pda.c index 286d341f2d..929b4a4d65 100644 --- a/modules/gui/pda/pda.c +++ b/modules/gui/pda/pda.c @@ -2,7 +2,7 @@ * pda.c : PDA Gtk2 plugin for vlc ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: pda.c,v 1.17 2003/12/06 22:41:40 jpsaman Exp $ + * $Id: pda.c,v 1.18 2003/12/22 14:32:56 sam Exp $ * * Authors: Jean-Paul Saman * Marc Ariberti @@ -188,7 +188,7 @@ static void Run( intf_thread_t *p_intf ) /* Get the notebook object */ p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) ); - + /* Get the slider object */ p_intf->p_sys->p_slider = (GtkHScale*) lookup_widget( p_intf->p_sys->p_window, "timeSlider" ); p_intf->p_sys->p_slider_label = (GtkLabel*) lookup_widget( p_intf->p_sys->p_window, "timeLabel" ); @@ -264,7 +264,7 @@ static void Run( intf_thread_t *p_intf ) /* BEGIN OF PLAYLIST GTK_TREE_VIEW */ p_intf->p_sys->p_tvplaylist = NULL; - p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist"); + p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist"); if (NULL == p_intf->p_sys->p_tvplaylist) msg_Err(p_intf, "Error obtaining pointer to Play List"); @@ -423,7 +423,7 @@ static int Manage( intf_thread_t *p_intf ) p_intf->p_sys->b_playing = 1; /* update playlist interface */ - p_playlist = (playlist_t *) vlc_object_find( + p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if (p_playlist != NULL) { @@ -442,7 +442,7 @@ static int Manage( intf_thread_t *p_intf ) #define p_area p_input->stream.p_selected_area if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) { - /* Manage the slider for CPU_CAPABILITY_FPU hardware */ + /* Manage the slider for CPU_CAPABILITY_FPU hardware */ if( p_input->stream.b_seekable && p_intf->p_sys->b_playing ) { float newvalue = p_intf->p_sys->p_adj->value; diff --git a/modules/gui/skins/x11/x11_api.cpp b/modules/gui/skins/x11/x11_api.cpp index 5040187e6c..564176df8f 100644 --- a/modules/gui/skins/x11/x11_api.cpp +++ b/modules/gui/skins/x11/x11_api.cpp @@ -2,9 +2,9 @@ * x11_api.cpp: Various x11-specific functions ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_api.cpp,v 1.9 2003/06/09 22:02:13 asmax Exp $ + * $Id: x11_api.cpp,v 1.10 2003/12/22 14:32:56 sam Exp $ * - * Authors: Cyril Deguet + * Author: Cyril Deguet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ void OSAPI_SendMessage( SkinWindow *win, unsigned int message, } //--------------------------------------------------------------------------- void OSAPI_PostMessage( SkinWindow *win, unsigned int message, - unsigned int param1, long param2 ) + unsigned int param1, long param2 ) { XEvent event; @@ -66,7 +66,7 @@ void OSAPI_PostMessage( SkinWindow *win, unsigned int message, event.xclient.data.l[0] = message; event.xclient.data.l[1] = param1; event.xclient.data.l[2] = param2; - + if( win == NULL ) { // broadcast message @@ -77,7 +77,7 @@ void OSAPI_PostMessage( SkinWindow *win, unsigned int message, event.xclient.window = (( X11Window *)win)->GetHandle(); } XLOCK; - XSendEvent( g_pIntf->p_sys->display, event.xclient.window, False, 0, + XSendEvent( g_pIntf->p_sys->display, event.xclient.window, False, 0, &event ); XUNLOCK; } @@ -122,10 +122,10 @@ void OSAPI_GetMousePos( int &x, int &y ) int rootx, rooty; int winx, winy; unsigned int xmask; - + Window root = DefaultRootWindow( g_pIntf->p_sys->display ); XLOCK; - XQueryPointer( g_pIntf->p_sys->display, root, &rootReturn, &childReturn, + XQueryPointer( g_pIntf->p_sys->display, root, &rootReturn, &childReturn, &rootx, &rooty, &winx, &winy, &xmask ); XUNLOCK; x = rootx; @@ -153,8 +153,8 @@ bool OSAPI_RmDir( string path ) /* Skip "." and ".." */ if( !*file->d_name || *file->d_name == '.' || - (!*(file->d_name+1) && *file->d_name == '.' && - *(file->d_name+1) == '.') ) + (!*(file->d_name+1) && *file->d_name == '.' && + *(file->d_name+1) == '.') ) { continue; } diff --git a/modules/misc/memcpy/memcpyaltivec.c b/modules/misc/memcpy/memcpyaltivec.c index 2c0a0a893e..bb7af70934 100644 --- a/modules/misc/memcpy/memcpyaltivec.c +++ b/modules/misc/memcpy/memcpyaltivec.c @@ -2,15 +2,15 @@ * memcpyaltivec.c : AltiVec memcpy module ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: memcpyaltivec.c,v 1.3 2003/03/30 18:14:38 gbazin Exp $ + * $Id: memcpyaltivec.c,v 1.4 2003/12/22 14:32:56 sam Exp $ * - * Authors: Christophe Massiot + * Author: Christophe Massiot * * This program 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. - * + * * This program 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 @@ -150,7 +150,7 @@ static void * fast_memcpy( void * _to, const void * _from, size_t len ) static void * fast_memcpy( void * _to, const void * _from, size_t len ) { - asm (" \n" + asm (" \n" " cmplwi %cr0, %r5, 16 \n" " mr %r9, %r3 \n" " bc 4, 1, ._L3 \n" diff --git a/modules/stream_out/duplicate.c b/modules/stream_out/duplicate.c index 8c66446d44..7a662e8055 100644 --- a/modules/stream_out/duplicate.c +++ b/modules/stream_out/duplicate.c @@ -2,9 +2,9 @@ * duplicate.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: duplicate.c,v 1.7 2003/12/14 17:58:37 gbazin Exp $ + * $Id: duplicate.c,v 1.8 2003/12/22 14:32:56 sam Exp $ * - * Authors: Laurent Aimar + * Author: Laurent Aimar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -153,7 +153,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt ) p_sys->pp_streams[i_stream], p_fmt ); /* Append failed attempts as well to keep track of which pp_id - * belongs to which duplicated stream */ + * belongs to which duplicated stream */ TAB_APPEND( id->i_nb_ids, id->pp_ids, id_new ); if( id_new ) i_valid_streams++; } diff --git a/modules/stream_out/transrate/getvlc.h b/modules/stream_out/transrate/getvlc.h index 9941f0af67..d1e8946ccb 100644 --- a/modules/stream_out/transrate/getvlc.h +++ b/modules/stream_out/transrate/getvlc.h @@ -92,7 +92,7 @@ static const MBtab MB_B [] = { {0, 0}, {INTRA|QUANT, 6}, {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6}, {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5}, - {INTRA, 5}, {INTRA, 5}, + {INTRA, 5}, {INTRA, 5}, {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, @@ -269,7 +269,7 @@ static const DCTtab DCT_B14_8 [] = { }; static const DCTtab DCT_B14AC_5 [] = { - { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, @@ -279,7 +279,7 @@ static const DCTtab DCT_B14AC_5 [] = { }; static const DCTtab DCT_B14DC_5 [] = { - { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, @@ -361,7 +361,7 @@ static const DCTtab DCT_B15_8 [] = { static const MBAtab MBA_5 [] = { - {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4}, + {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1} diff --git a/modules/video_chroma/i420_rgb.c b/modules/video_chroma/i420_rgb.c index 49efea78fb..5522a2022b 100644 --- a/modules/video_chroma/i420_rgb.c +++ b/modules/video_chroma/i420_rgb.c @@ -2,15 +2,15 @@ * i420_rgb.c : YUV to bitmap RGB conversion module for vlc ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: i420_rgb.c,v 1.5 2003/12/04 12:33:43 gbazin Exp $ + * $Id: i420_rgb.c,v 1.6 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Author: Sam Hocevar * * This program 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. - * + * * This program 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 @@ -123,7 +123,7 @@ static int Activate( vlc_object_t *p_this ) break; #ifndef WIN32 /* Hmmm, is there only X11 using 32bits per pixel for RV24 ? */ - case VLC_FOURCC('R','V','2','4'): + case VLC_FOURCC('R','V','2','4'): #endif case VLC_FOURCC('R','V','3','2'): #if defined (MODULE_NAME_IS_i420_rgb_mmx) @@ -146,7 +146,7 @@ static int Activate( vlc_object_t *p_this ) default: return -1; } - + p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) ); if( p_vout->chroma.p_sys == NULL ) { @@ -220,7 +220,7 @@ static int Activate( vlc_object_t *p_this ) SetYUV( p_vout ); #endif - return 0; + return 0; } /***************************************************************************** diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c index 9283aeefed..35c1e2291b 100644 --- a/modules/video_filter/deinterlace/deinterlace.c +++ b/modules/video_filter/deinterlace/deinterlace.c @@ -2,9 +2,9 @@ * deinterlace.c : deinterlacer plugin for vlc ***************************************************************************** * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN - * $Id: deinterlace.c,v 1.17 2003/11/06 16:54:40 nitrox Exp $ + * $Id: deinterlace.c,v 1.18 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Author: Sam Hocevar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -376,7 +376,7 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic ) vlc_mutex_unlock( &p_vout->p_sys->filter_lock ); return; } - msleep( VOUT_OUTMEM_SLEEP ); + msleep( VOUT_OUTMEM_SLEEP ); } /* 20ms is a bit arbitrary, but it's only for the first image we get */ @@ -706,7 +706,7 @@ static void RenderBlend( vout_thread_t *p_vout, picture_t *p_outpic, picture_t *p_pic ) { int i_plane; - + /* Copy image and skip lines */ for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) { diff --git a/modules/video_output/qte/qte.cpp b/modules/video_output/qte/qte.cpp index 67920dfa33..386a70f179 100644 --- a/modules/video_output/qte/qte.cpp +++ b/modules/video_output/qte/qte.cpp @@ -2,7 +2,7 @@ * qte.cpp : QT Embedded plugin for vlc ***************************************************************************** * Copyright (C) 1998-2003 VideoLAN - * $Id: qte.cpp,v 1.19 2003/05/24 12:55:38 jpsaman Exp $ + * $Id: qte.cpp,v 1.20 2003/12/22 14:32:56 sam Exp $ * * Authors: Gerald Hansink * Jean-Paul Saman @@ -290,7 +290,7 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic ) &x, &y, &w, &h ); #if 0 msg_Dbg(p_vout, "+qte::Display( p_vout, i_width=%d, i_height=%d, x=%u, y=%u, w=%u, h=%u", - p_vout->output.i_width, p_vout->output.i_height, x, y, w, h ); + p_vout->output.i_width, p_vout->output.i_height, x, y, w, h ); #endif if(p_vout->p_sys->p_VideoWidget) @@ -607,7 +607,7 @@ static void RunQtThread(event_thread_t *p_event) } QWidget* pWidget = new QWidget(); if (pWidget) - { + { p_event->p_vout->p_sys->p_VideoWidget = pWidget; } } @@ -619,31 +619,31 @@ static void RunQtThread(event_thread_t *p_event) if (p_event->p_vout->p_sys->p_QApplication) { /* Set default window width and heigh to exactly preferred size. */ - QWidget *desktop = p_event->p_vout->p_sys->p_QApplication->desktop(); - p_event->p_vout->p_sys->p_VideoWidget->setMinimumWidth( 10 ); - p_event->p_vout->p_sys->p_VideoWidget->setMinimumHeight( 10 ); - p_event->p_vout->p_sys->p_VideoWidget->setBaseSize( p_event->p_vout->p_sys->i_width, - p_event->p_vout->p_sys->i_height ); + QWidget *desktop = p_event->p_vout->p_sys->p_QApplication->desktop(); + p_event->p_vout->p_sys->p_VideoWidget->setMinimumWidth( 10 ); + p_event->p_vout->p_sys->p_VideoWidget->setMinimumHeight( 10 ); + p_event->p_vout->p_sys->p_VideoWidget->setBaseSize( p_event->p_vout->p_sys->i_width, + p_event->p_vout->p_sys->i_height ); p_event->p_vout->p_sys->p_VideoWidget->setMaximumWidth( desktop->width() ); p_event->p_vout->p_sys->p_VideoWidget->setMaximumHeight( desktop->height() ); /* Check on fullscreen */ if (p_event->p_vout->b_fullscreen) - p_event->p_vout->p_sys->p_VideoWidget->showFullScreen(); + p_event->p_vout->p_sys->p_VideoWidget->showFullScreen(); else - p_event->p_vout->p_sys->p_VideoWidget->showNormal(); + p_event->p_vout->p_sys->p_VideoWidget->showNormal(); p_event->p_vout->p_sys->p_VideoWidget->show(); p_event->p_vout->p_sys->bRunning = TRUE; #ifdef NEED_QTE_MAIN while(!p_event->b_die && p_event->p_vout->p_sys->bRunning) - { - /* Check if we are asked to exit */ + { + /* Check if we are asked to exit */ if( p_event->b_die ) break; - msleep(100); - } + msleep(100); + } #else // run the main loop of qtapplication until someone says: 'quit' p_event->p_vout->p_sys->pcQApplication->exec(); diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c index 21fa0eb8fc..6506be4d84 100644 --- a/modules/video_output/x11/xcommon.c +++ b/modules/video_output/x11/xcommon.c @@ -2,10 +2,10 @@ * xcommon.c: Functions common to the X11 and XVideo plugins ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: xcommon.c,v 1.40 2003/12/08 19:50:22 gbazin Exp $ + * $Id: xcommon.c,v 1.41 2003/12/22 14:32:56 sam Exp $ * * Authors: Vincent Seguin - * Samuel Hocevar + * Sam Hocevar * David Kennedy * Gildas Bazin * @@ -282,7 +282,7 @@ int E_(Activate) ( vlc_object_t *p_this ) TestNetWMSupport( p_vout ); /* Add a variable to indicate if the window should be on top of others */ - var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); + var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); text.psz_string = _("Always on top"); var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL ); var_AddCallback( p_vout, "video-on-top", OnTopCallback, NULL ); @@ -581,7 +581,7 @@ static int ManageVideo( vout_thread_t *p_vout ) var_Get( p_vout, "mouse-button-down", &val ); val.i_int |= 1; var_Set( p_vout, "mouse-button-down", val ); - + /* detect double-clicks */ if( ( ((XButtonEvent *)&xevent)->time - p_vout->p_sys->i_time_button_last_pressed ) < 300 ) @@ -597,13 +597,13 @@ static int ManageVideo( vout_thread_t *p_vout ) val.i_int |= 2; var_Set( p_vout, "mouse-button-down", val ); break; - + case Button3: var_Get( p_vout, "mouse-button-down", &val ); val.i_int |= 4; var_Set( p_vout, "mouse-button-down", val ); break; - + case Button4: var_Get( p_vout, "mouse-button-down", &val ); val.i_int |= 8; @@ -632,7 +632,7 @@ static int ManageVideo( vout_thread_t *p_vout ) val.b_bool = VLC_TRUE; var_Set( p_vout, "mouse-clicked", val ); break; - + case Button2: { playlist_t *p_playlist; @@ -654,7 +654,7 @@ static int ManageVideo( vout_thread_t *p_vout ) } } break; - + case Button3: { intf_thread_t *p_intf; @@ -694,7 +694,7 @@ static int ManageVideo( vout_thread_t *p_vout ) val.i_int &= ~16; var_Set( p_vout, "mouse-button-down", val ); break; - + } } /* Mouse move */ diff --git a/modules/visualization/visual/fft.c b/modules/visualization/visual/fft.c index 40473bcd67..465c3be958 100644 --- a/modules/visualization/visual/fft.c +++ b/modules/visualization/visual/fft.c @@ -1,10 +1,10 @@ /***************************************************************************** * fft.c: Iterative implementation of a FFT ***************************************************************************** - * $Id: fft.c,v 1.2 2003/10/24 17:43:51 sam Exp $ + * $Id: fft.c,v 1.3 2003/12/22 14:32:56 sam Exp $ * * Mainly taken from XMMS's code - * + * * Authors: Richard Boulton * Ralph Loader * @@ -12,7 +12,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. - * + * * This program 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 @@ -36,7 +36,7 @@ #endif /****************************************************************************** - * Local prototypes + * Local prototypes *****************************************************************************/ static void fft_prepare(const sound_sample *input, float * re, float * im); static void fft_calculate(float * re, float * im); @@ -62,24 +62,24 @@ static float costable[FFT_BUFFER_SIZE / 2]; * On error, returns NULL. * The pointer should be freed when it is finished with, by fft_close(). */ -fft_state *visual_fft_init(void) +fft_state *visual_fft_init(void) { fft_state *p_state; unsigned int i; p_state = (fft_state *) malloc (sizeof(fft_state)); - if(! p_state ) + if(! p_state ) return NULL; - for(i = 0; i < FFT_BUFFER_SIZE; i++) + for(i = 0; i < FFT_BUFFER_SIZE; i++) { - bitReverse[i] = reverseBits(i); + bitReverse[i] = reverseBits(i); } - for(i = 0; i < FFT_BUFFER_SIZE / 2; i++) + for(i = 0; i < FFT_BUFFER_SIZE / 2; i++) { - float j = 2 * PI * i / FFT_BUFFER_SIZE; - costable[i] = cos(j); - sintable[i] = sin(j); + float j = 2 * PI * i / FFT_BUFFER_SIZE; + costable[i] = cos(j); + sintable[i] = sin(j); } return p_state; @@ -123,12 +123,12 @@ static void fft_prepare(const sound_sample *input, float * re, float * im) { unsigned int i; float *p_real = re; float *p_imag = im; - + /* Get input, in reverse bit order */ - for(i = 0; i < FFT_BUFFER_SIZE; i++) + for(i = 0; i < FFT_BUFFER_SIZE; i++) { - *p_real++ = input[bitReverse[i]]; - *p_imag++ = 0; + *p_real++ = input[bitReverse[i]]; + *p_imag++ = 0; } } @@ -142,11 +142,11 @@ static void fft_output(const float * re, const float * im, float *output) const float *p_real = re; const float *p_imag = im; float *p_end = output + FFT_BUFFER_SIZE / 2; - - while(p_output <= p_end) + + while(p_output <= p_end) { - *p_output = (*p_real * *p_real) + (*p_imag * *p_imag); - p_output++; p_real++; p_imag++; + *p_output = (*p_real * *p_real) + (*p_imag * *p_imag); + p_output++; p_real++; p_imag++; } /* Do divisions to keep the constant and highest frequency terms in scale * with the other terms. */ @@ -158,56 +158,56 @@ static void fft_output(const float * re, const float * im, float *output) /* * Actually perform the FFT */ -static void fft_calculate(float * re, float * im) +static void fft_calculate(float * re, float * im) { unsigned int i, j, k; unsigned int exchanges; float fact_real, fact_imag; float tmp_real, tmp_imag; unsigned int factfact; - + /* Set up some variables to reduce calculation in the loops */ exchanges = 1; factfact = FFT_BUFFER_SIZE / 2; /* Loop through the divide and conquer steps */ for(i = FFT_BUFFER_SIZE_LOG; i != 0; i--) { - /* In this step, we have 2 ^ (i - 1) exchange groups, each with - * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges - */ - /* Loop through the exchanges in a group */ - for(j = 0; j != exchanges; j++) { - /* Work out factor for this exchange - * factor ^ (exchanges) = -1 - * So, real = cos(j * PI / exchanges), - * imag = sin(j * PI / exchanges) - */ - fact_real = costable[j * factfact]; - fact_imag = sintable[j * factfact]; - - /* Loop through all the exchange groups */ - for(k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { - int k1 = k + exchanges; - tmp_real = fact_real * re[k1] - fact_imag * im[k1]; - tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; - re[k1] = re[k] - tmp_real; - im[k1] = im[k] - tmp_imag; - re[k] += tmp_real; - im[k] += tmp_imag; - } - } - exchanges <<= 1; - factfact >>= 1; + /* In this step, we have 2 ^ (i - 1) exchange groups, each with + * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges + */ + /* Loop through the exchanges in a group */ + for(j = 0; j != exchanges; j++) { + /* Work out factor for this exchange + * factor ^ (exchanges) = -1 + * So, real = cos(j * PI / exchanges), + * imag = sin(j * PI / exchanges) + */ + fact_real = costable[j * factfact]; + fact_imag = sintable[j * factfact]; + + /* Loop through all the exchange groups */ + for(k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { + int k1 = k + exchanges; + tmp_real = fact_real * re[k1] - fact_imag * im[k1]; + tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; + re[k1] = re[k] - tmp_real; + im[k1] = im[k] - tmp_imag; + re[k] += tmp_real; + im[k] += tmp_imag; + } + } + exchanges <<= 1; + factfact >>= 1; } } -static int reverseBits(unsigned int initial) +static int reverseBits(unsigned int initial) { unsigned int reversed = 0, loop; for(loop = 0; loop < FFT_BUFFER_SIZE_LOG; loop++) { - reversed <<= 1; - reversed += (initial & 1); - initial >>= 1; + reversed <<= 1; + reversed += (initial & 1); + initial >>= 1; } return reversed; } diff --git a/src/input/demux.c b/src/input/demux.c index 3211cd1850..9bba5747d5 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -2,9 +2,9 @@ * demux.c ***************************************************************************** * Copyright (C) 1999-2003 VideoLAN - * $Id: demux.c,v 1.5 2003/11/30 17:29:56 fenrir Exp $ + * $Id: demux.c,v 1.6 2003/12/22 14:32:56 sam Exp $ * - * Authors: Laurent Aimar + * Author: Laurent Aimar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ int demux_vaControlDefault( input_thread_t *p_input, int i_query, case DEMUX_SET_POSITION: f = (double)va_arg( args, double ); if( p_input->stream.b_seekable && p_input->pf_seek != NULL && - f >= 0.0 && f <= 1.0 ) + f >= 0.0 && f <= 1.0 ) { SeekOffset( p_input, (int64_t)(f * (double)p_input->stream.p_selected_area->i_size) ); @@ -109,7 +109,7 @@ int demux_vaControlDefault( input_thread_t *p_input, int i_query, i64 = (int64_t)va_arg( args, int64_t ); if( p_input->stream.i_mux_rate > 0 && p_input->stream.b_seekable && - p_input->pf_seek != NULL && i64 >= 0 ) + p_input->pf_seek != NULL && i64 >= 0 ) { SeekOffset( p_input, i64 * 50 * (int64_t)p_input->stream.i_mux_rate / diff --git a/src/input/input_ext-intf.c b/src/input/input_ext-intf.c index 307541e10e..6605937786 100644 --- a/src/input/input_ext-intf.c +++ b/src/input/input_ext-intf.c @@ -2,9 +2,9 @@ * input_ext-intf.c: services to the interface ***************************************************************************** * Copyright (C) 1998-2001,2003 VideoLAN - * $Id: input_ext-intf.c,v 1.53 2003/12/03 13:27:51 rocky Exp $ + * $Id: input_ext-intf.c,v 1.54 2003/12/22 14:32:56 sam Exp $ * - * Authors: Christophe Massiot + * Author: Christophe Massiot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -308,7 +308,7 @@ char * input_OffsetToTime( input_thread_t * p_input, char * psz_buffer, if( p_input->stream.i_mux_rate ) { i_seconds = i_offset / 50 / p_input->stream.i_mux_rate; - return secstotimestr( psz_buffer, i_seconds ); + return secstotimestr( psz_buffer, i_seconds ); } else { diff --git a/src/input/subtitles.c b/src/input/subtitles.c index 0fd22cec24..6749b2e8e9 100644 --- a/src/input/subtitles.c +++ b/src/input/subtitles.c @@ -2,7 +2,7 @@ * subtitles.c ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: subtitles.c,v 1.5 2003/12/02 12:57:36 gbazin Exp $ + * $Id: subtitles.c,v 1.6 2003/12/22 14:32:56 sam Exp $ * * Authors: Derk-Jan Hartman * This is adapted code from the GPL'ed MPlayer (http://mplayerhq.hu) @@ -68,54 +68,54 @@ static void strcpy_trim( char *d, char *s ) /* skip leading whitespace */ while( *s && !isalnum(*s) ) { - s++; + s++; } for(;;) { - /* copy word */ - while( *s && isalnum(*s) ) + /* copy word */ + while( *s && isalnum(*s) ) { - *d = tolower(*s); - s++; d++; - } - if (*s == 0) break; - /* trim excess whitespace */ - while( *s && !isalnum(*s) ) + *d = tolower(*s); + s++; d++; + } + if (*s == 0) break; + /* trim excess whitespace */ + while( *s && !isalnum(*s) ) { - s++; - } - if( *s == 0 ) break; - *d++ = ' '; + s++; + } + if( *s == 0 ) break; + *d++ = ' '; } *d = 0; } - + static void strcpy_strip_ext( char *d, char *s ) { char *tmp = strrchr(s, '.'); if( !tmp ) { - strcpy(d, s); - return; + strcpy(d, s); + return; } else { - strncpy(d, s, tmp - s); - d[tmp - s] = 0; + strncpy(d, s, tmp - s); + d[tmp - s] = 0; } while( *d ) { - *d = tolower(*d); - d++; + *d = tolower(*d); + d++; } } - + static void strcpy_get_ext( char *d, char *s ) { char *tmp = strrchr(s, '.'); if( !tmp ) { - strcpy(d, ""); - return; + strcpy(d, ""); + return; } else strcpy( d, tmp + 1 ); } @@ -123,13 +123,13 @@ static int whiteonly( char *s ) { while ( *s ) { - if( isalnum( *s ) ) return 0; - s++; + if( isalnum( *s ) ) return 0; + s++; } return 1; } -typedef struct _subfn +typedef struct _subfn { int priority; char *psz_fname; @@ -137,22 +137,26 @@ typedef struct _subfn static int compare_sub_priority( const void *a, const void *b ) { - if (((subfn*)a)->priority > ((subfn*)b)->priority) { - return -1; - } else if (((subfn*)a)->priority < ((subfn*)b)->priority) { - return 1; - } else { - return strcoll(((subfn*)a)->psz_fname, ((subfn*)b)->psz_fname); + if (((subfn*)a)->priority > ((subfn*)b)->priority) + { + return -1; } + + if (((subfn*)a)->priority < ((subfn*)b)->priority) + { + return 1; + } + + return strcoll(((subfn*)a)->psz_fname, ((subfn*)b)->psz_fname); } /** * Detect subtitle files. - * + * * When called this function will split up the psz_fname string into a * directory, filename and extension. It then opens the directory * in which the file resides and tries to find possible matches of - * subtitles files. + * subtitles files. * * \ingroup Demux * \param p_this the calling \ref input_thread_t @@ -167,12 +171,12 @@ char** subtitles_Detect( input_thread_t *p_this, char *psz_path, char *psz_fname char *f_dir, *f_fname, *f_fname_noext, *f_fname_trim, *tmp; /* variables to be used for derivatives FILE *f */ char *tmp_fname_noext, *tmp_fname_trim, *tmp_fname_ext, *tmpresult; - + vlc_value_t fuzzy; int len, i, j, i_sub_count; subfn *result; /* unsorted results */ char **result2; /* sorted results */ - + FILE *f; DIR *d; struct dirent *de; @@ -200,59 +204,59 @@ char** subtitles_Detect( input_thread_t *p_this, char *psz_path, char *psz_fname if( tmp ) { int pos; - strcpy( f_fname, tmp + 1 ); - pos = tmp - psz_fname; - strncpy( f_dir, psz_fname, pos + 1 ); - f_dir[pos + 1] = 0; + strcpy( f_fname, tmp + 1 ); + pos = tmp - psz_fname; + strncpy( f_dir, psz_fname, pos + 1 ); + f_dir[pos + 1] = 0; } else { - strcpy( f_fname, psz_fname ); - strcpy( f_dir, "" ); + strcpy( f_fname, psz_fname ); + strcpy( f_dir, "" ); } strcpy_strip_ext( f_fname_noext, f_fname ); strcpy_trim( f_fname_trim, f_fname_noext ); var_Get( p_this, "sub-autodetect-fuzzy", &fuzzy ); - - + + for( j = 0; j <= 1; j++) { - d = opendir( j == 0 ? f_dir : psz_path ); - if( d ) + d = opendir( j == 0 ? f_dir : psz_path ); + if( d ) { int b_found; - while( ( de = readdir( d ) ) ) + while( ( de = readdir( d ) ) ) { - /* retrieve various parts of the filename */ - strcpy_strip_ext( tmp_fname_noext, de->d_name ); - strcpy_get_ext( tmp_fname_ext, de->d_name ); - strcpy_trim( tmp_fname_trim, tmp_fname_noext ); - - /* does it end with a subtitle extension? */ - b_found = 0; - for( i = 0; sub_exts[i]; i++ ) + /* retrieve various parts of the filename */ + strcpy_strip_ext( tmp_fname_noext, de->d_name ); + strcpy_get_ext( tmp_fname_ext, de->d_name ); + strcpy_trim( tmp_fname_trim, tmp_fname_noext ); + + /* does it end with a subtitle extension? */ + b_found = 0; + for( i = 0; sub_exts[i]; i++ ) { - if( strcmp(sub_exts[i], tmp_fname_ext ) == 0 ) + if( strcmp(sub_exts[i], tmp_fname_ext ) == 0 ) { - b_found = 1; + b_found = 1; msg_Dbg( p_this, "found a possible subtitle: %s", de->d_name ); - break; - } - } - - /* we have a (likely) subtitle file */ - if( b_found ) + break; + } + } + + /* we have a (likely) subtitle file */ + if( b_found ) { - int i_prio = 0; - if( !i_prio && strcmp( tmp_fname_trim, f_fname_trim ) == 0 ) + int i_prio = 0; + if( !i_prio && strcmp( tmp_fname_trim, f_fname_trim ) == 0 ) { - /* matches the movie name exactly */ - i_prio = 4; - } - if( !i_prio && ( tmp = strstr( tmp_fname_trim, f_fname_trim ) ) ) + /* matches the movie name exactly */ + i_prio = 4; + } + if( !i_prio && ( tmp = strstr( tmp_fname_trim, f_fname_trim ) ) ) { - /* contains the movie name */ + /* contains the movie name */ tmp += strlen( f_fname_trim ); if( whiteonly( tmp ) ) { @@ -264,33 +268,33 @@ char** subtitles_Detect( input_thread_t *p_this, char *psz_path, char *psz_fname /* chars after (and possibly in front of) the movie name */ i_prio = 3; } - } - if( !i_prio ) + } + if( !i_prio ) { - /* doesn't contain the movie name */ - if( j == 0 ) i_prio = 1; - } - - if( i_prio >= fuzzy.i_int ) + /* doesn't contain the movie name */ + if( j == 0 ) i_prio = 1; + } + + if( i_prio >= fuzzy.i_int ) { sprintf( tmpresult, "%s%s", j == 0 ? f_dir : psz_path, de->d_name ); msg_Dbg( p_this, "autodetected subtitle: %s with priority %d", de->d_name, i_prio ); - if( ( f = fopen( tmpresult, "rt" ) ) ) + if( ( f = fopen( tmpresult, "rt" ) ) ) { - fclose( f ); - result[i_sub_count].priority = i_prio; - result[i_sub_count].psz_fname = strdup( tmpresult ); - i_sub_count++; - } - } - - } - if( i_sub_count >= MAX_SUBTITLE_FILES ) break; - } - closedir( d ); - } + fclose( f ); + result[i_sub_count].priority = i_prio; + result[i_sub_count].psz_fname = strdup( tmpresult ); + i_sub_count++; + } + } + + } + if( i_sub_count >= MAX_SUBTITLE_FILES ) break; + } + closedir( d ); + } } - + free( f_dir ); free( f_fname ); free( f_fname_noext ); @@ -309,7 +313,7 @@ char** subtitles_Detect( input_thread_t *p_this, char *psz_path, char *psz_fname for( i = 0; i < i_sub_count; i++ ) { - result2[i] = result[i].psz_fname; + result2[i] = result[i].psz_fname; } result2[i_sub_count] = NULL; free( result ); diff --git a/src/interface/intf_eject.c b/src/interface/intf_eject.c index 6f3bd04f5f..cfef93cd48 100644 --- a/src/interface/intf_eject.c +++ b/src/interface/intf_eject.c @@ -2,12 +2,12 @@ * intf_eject.c: CD/DVD-ROM ejection handling functions ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: intf_eject.c,v 1.21 2003/09/18 17:54:02 zorglub Exp $ + * $Id: intf_eject.c,v 1.22 2003/12/22 14:32:56 sam Exp $ * - * Author: Julien Blache for the Linux part - * with code taken from the Linux "eject" command - * Jon Lech Johansen for Darwin - * Gildas Bazin for Win32 + * Authors: Julien Blache for the Linux part + * with code taken from the Linux "eject" command + * Jon Lech Johansen for Darwin + * Gildas Bazin for Win32 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,7 +110,7 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) * The only way to cleanly unmount the disc under MacOS X * is to use the 'disktool' command line utility. It uses * the non-public Disk Arbitration API, which can not be - * used by Cocoa or Carbon applications. + * used by Cocoa or Carbon applications. */ if( ( psz_disk = (char *)strstr( psz_device, "disk" ) ) != NULL && @@ -165,13 +165,13 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE; - if( !mciSendCommand( 0, MCI_OPEN, i_flags, (unsigned long)&op ) ) + if( !mciSendCommand( 0, MCI_OPEN, i_flags, (unsigned long)&op ) ) { st.dwItem = MCI_STATUS_READY; - /* Eject disc */ + /* Eject disc */ i_ret = mciSendCommand( op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0 ); - /* Release access to the device */ - mciSendCommand( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 ); + /* Release access to the device */ + mciSendCommand( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 ); } else i_ret = VLC_EGENERIC; @@ -183,7 +183,7 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) /* This code could be extended to support CD/DVD-ROM chargers */ i_fd = open( psz_device, O_RDONLY | O_NONBLOCK ); - + if( i_fd == -1 ) { msg_Err( p_this, "could not open device %s", psz_device ); @@ -269,7 +269,7 @@ static int EjectSCSI( int i_fd ) { return VLC_EGENERIC; } - + scsi_cmd.inlen = 0; scsi_cmd.outlen = 0; scsi_cmd.cmd[0] = START_STOP; @@ -283,10 +283,10 @@ static int EjectSCSI( int i_fd ) { return VLC_EGENERIC; } - + /* Force kernel to reread partition table when new disc inserted */ i_status = ioctl( i_fd, BLKRRPART ); - + return i_status; } #endif diff --git a/src/misc/charset.c b/src/misc/charset.c index cb08c60992..bf47bab991 100644 --- a/src/misc/charset.c +++ b/src/misc/charset.c @@ -3,9 +3,9 @@ * encoding. ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: charset.c,v 1.4 2003/10/11 21:08:40 hartman Exp $ + * $Id: charset.c,v 1.5 2003/12/22 14:32:56 sam Exp $ * - * Authors: Derk-Jan Hartman + * Author: Derk-Jan Hartman * * vlc_current_charset() an adaption of mp_locale_charset(): * @@ -52,12 +52,12 @@ typedef struct VLCCharsetAlias /* * The libcharset load all from external text file, but it's strange and - * slow solution, we rather use array(s) compiled into source. In the + * slow solution, we rather use array(s) compiled into source. In the * "good" libc this is not needful -- for example in linux. - * + * * Please, put to this funtion exotic aliases only. The libc 'iconv' knows * a lot of basic aliases (check it first by iconv -l). - * + * */ static const char* vlc_encoding_from_language( const char *l ) @@ -72,8 +72,8 @@ static const char* vlc_encoding_from_language( const char *l ) if (strstr(l, "ru")) return "KOI8-R"; if (strstr(l, "uk")) return "KOI8-U"; if (strstr(l, "pl") || strstr(l, "hr") || - strstr(l, "hu") || strstr(l, "cs") || - strstr(l, "sk") || strstr(l, "sl")) return "ISO-8859-2"; + strstr(l, "hu") || strstr(l, "cs") || + strstr(l, "sk") || strstr(l, "sl")) return "ISO-8859-2"; if (strstr(l, "eo") || strstr(l, "mt")) return "ISO-8859-3"; if (strstr(l, "lt") || strstr(l, "la")) return "ISO-8859-4"; if (strstr(l, "bg") || strstr(l, "be") || @@ -95,82 +95,82 @@ static const char* vlc_encoding_from_language( const char *l ) static const char* vlc_charset_aliases( const char *psz_name ) { - VLCCharsetAlias *a; + VLCCharsetAlias *a; #if defined WIN32 - VLCCharsetAlias aliases[] = + VLCCharsetAlias aliases[] = { - { "CP936", "GBK" }, - { "CP1361", "JOHAB" }, - { "CP20127", "ASCII" }, - { "CP20866", "KOI8-R" }, - { "CP21866", "KOI8-RU" }, - { "CP28591", "ISO-8859-1" }, - { "CP28592", "ISO-8859-2" }, - { "CP28593", "ISO-8859-3" }, - { "CP28594", "ISO-8859-4" }, - { "CP28595", "ISO-8859-5" }, - { "CP28596", "ISO-8859-6" }, - { "CP28597", "ISO-8859-7" }, - { "CP28598", "ISO-8859-8" }, - { "CP28599", "ISO-8859-9" }, - { "CP28605", "ISO-8859-15" }, - { NULL, NULL } + { "CP936", "GBK" }, + { "CP1361", "JOHAB" }, + { "CP20127", "ASCII" }, + { "CP20866", "KOI8-R" }, + { "CP21866", "KOI8-RU" }, + { "CP28591", "ISO-8859-1" }, + { "CP28592", "ISO-8859-2" }, + { "CP28593", "ISO-8859-3" }, + { "CP28594", "ISO-8859-4" }, + { "CP28595", "ISO-8859-5" }, + { "CP28596", "ISO-8859-6" }, + { "CP28597", "ISO-8859-7" }, + { "CP28598", "ISO-8859-8" }, + { "CP28599", "ISO-8859-9" }, + { "CP28605", "ISO-8859-15" }, + { NULL, NULL } }; #elif SYS_AIX VLCCharsetAlias aliases[] = { - { "IBM-850", "CP850" }, - { "IBM-856", "CP856" }, - { "IBM-921", "ISO-8859-13" }, - { "IBM-922", "CP922" }, - { "IBM-932", "CP932" }, - { "IBM-943", "CP943" }, - { "IBM-1046", "CP1046" }, - { "IBM-1124", "CP1124" }, - { "IBM-1129", "CP1129" }, - { "IBM-1252", "CP1252" }, - { "IBM-EUCCN", "GB2312" }, - { "IBM-EUCJP", "EUC-JP" }, - { "IBM-EUCKR", "EUC-KR" }, - { "IBM-EUCTW", "EUC-TW" }, - { NULL, NULL } + { "IBM-850", "CP850" }, + { "IBM-856", "CP856" }, + { "IBM-921", "ISO-8859-13" }, + { "IBM-922", "CP922" }, + { "IBM-932", "CP932" }, + { "IBM-943", "CP943" }, + { "IBM-1046", "CP1046" }, + { "IBM-1124", "CP1124" }, + { "IBM-1129", "CP1129" }, + { "IBM-1252", "CP1252" }, + { "IBM-EUCCN", "GB2312" }, + { "IBM-EUCJP", "EUC-JP" }, + { "IBM-EUCKR", "EUC-KR" }, + { "IBM-EUCTW", "EUC-TW" }, + { NULL, NULL } }; -#elif SYS_HPUX +#elif SYS_HPUX VLCCharsetAlias aliases[] = { - { "ROMAN8", "HP-ROMAN8" }, - { "ARABIC8", "HP-ARABIC8" }, - { "GREEK8", "HP-GREEK8" }, - { "HEBREW8", "HP-HEBREW8" }, - { "TURKISH8", "HP-TURKISH8" }, - { "KANA8", "HP-KANA8" }, - { "HP15CN", "GB2312" }, + { "ROMAN8", "HP-ROMAN8" }, + { "ARABIC8", "HP-ARABIC8" }, + { "GREEK8", "HP-GREEK8" }, + { "HEBREW8", "HP-HEBREW8" }, + { "TURKISH8", "HP-TURKISH8" }, + { "KANA8", "HP-KANA8" }, + { "HP15CN", "GB2312" }, { NULL, NULL } }; #elif SYS_IRIX VLCCharsetAlias aliases[] = { - { "EUCCN", "GB2312" }, + { "EUCCN", "GB2312" }, { NULL, NULL } }; -#elif SYS_OSF +#elif SYS_OSF VLCCharsetAlias aliases[] = { - { "KSC5601", "CP949" }, - { "SDECKANJI", "EUC-JP" }, - { "TACTIS", "TIS-620" }, + { "KSC5601", "CP949" }, + { "SDECKANJI", "EUC-JP" }, + { "TACTIS", "TIS-620" }, { NULL, NULL } }; #elif SYS_SOLARIS VLCCharsetAlias aliases[] = { - { "646", "ASCII" }, - { "CNS11643", "EUC-TW" }, - { "5601", "EUC-KR" }, - { "JOHAP92", "JOHAB" }, - { "PCK", "SHIFT_JIS" }, - { "2533", "TIS-620" }, + { "646", "ASCII" }, + { "CNS11643", "EUC-TW" }, + { "5601", "EUC-KR" }, + { "JOHAP92", "JOHAB" }, + { "PCK", "SHIFT_JIS" }, + { "2533", "TIS-620" }, { NULL, NULL } }; #elif SYS_BSD @@ -190,10 +190,9 @@ static const char* vlc_charset_aliases( const char *psz_name ) if (strcasecmp (a->psz_alias, psz_name) == 0) return a->psz_name; } - + /* we return original name beacuse iconv() probably will know - * something better about name if we don't know it :-) - */ + * something better about name if we don't know it :-) */ return psz_name; } @@ -208,10 +207,10 @@ static char *vlc_encoding_from_locale( char *psz_locale ) static char buf[2 + 10 + 1]; psz_dot++; - + /* Look for the possible @... trailer and remove it, if any. */ psz_modifier = strchr( psz_dot, '@' ); - + if( psz_modifier == NULL ) return psz_dot; if( 0 < ( psz_modifier - psz_dot ) < sizeof( buf )) @@ -241,8 +240,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset ) /* But most old systems don't have a complete set of locales. Some * (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't * use setlocale here; it would return "C" when it doesn't support the - * locale name the user has set. Darwin's setlocale is broken. - */ + * locale name the user has set. Darwin's setlocale is broken. */ # if HAVE_SETLOCALE && !SYS_DARWIN psz_locale = setlocale( LC_ALL, NULL ); # endif @@ -258,8 +256,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset ) } /* On some old systems, one used to set locale = "iso8859_1". On others, - * you set it to "language_COUNTRY.charset". Darwin only has LANG :( - */ + * you set it to "language_COUNTRY.charset". Darwin only has LANG :( */ psz_codeset = vlc_encoding_from_locale( (char *)psz_locale ); # endif /* HAVE_LANGINFO_CODESET */ @@ -279,8 +276,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset ) ULONG cplen; /* Allow user to override the codeset, as set in the operating system, - * with standard language environment variables. - */ + * with standard language environment variables. */ psz_locale = getenv( "LC_ALL" ); if( psz_locale == NULL || psz_locale[0] == '\0' ) { @@ -292,7 +288,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset ) psz_codeset = vlc_encoding_from_locale( psz_locale ); else { - /* OS/2 has a function returning the locale's codepage as a number. */ + /* OS/2 has a function returning the locale's codepage as a number. */ if( DosQueryCp( sizeof( cp ), cp, &cplen ) ) psz_codeset = ""; else @@ -303,30 +299,27 @@ vlc_bool_t vlc_current_charset( char **psz_charset ) } #endif if( psz_codeset == NULL ) - /* The canonical name cannot be determined. */ + /* The canonical name cannot be determined. */ psz_codeset = ""; else psz_codeset = vlc_charset_aliases( psz_codeset ); - + /* Don't return an empty string. GNU libc and GNU libiconv interpret * the empty string as denoting "the locale's character encoding", - * thus GNU libiconv would call this function a second time. - */ + * thus GNU libiconv would call this function a second time. */ if( psz_codeset[0] == '\0' ) { - /* - * Last possibility is 'CHARSET' enviroment variable - */ + /* Last possibility is 'CHARSET' enviroment variable */ if( !( psz_codeset = getenv( "CHARSET" ) ) ) psz_codeset = "ISO-8859-1"; } - + if( psz_charset ) *psz_charset = strdup((char *)psz_codeset); - if (strcasecmp(psz_codeset, "UTF8")==0 || strcasecmp(psz_codeset, "UTF-8")==0) + if( !strcasecmp(psz_codeset, "UTF8") || !strcasecmp(psz_codeset, "UTF-8") ) return VLC_TRUE; - + return VLC_FALSE; } diff --git a/src/misc/darwin_specific.m b/src/misc/darwin_specific.m index d357d2f055..b40a49140f 100644 --- a/src/misc/darwin_specific.m +++ b/src/misc/darwin_specific.m @@ -1,17 +1,17 @@ /***************************************************************************** - * darwin_specific.m: Darwin specific features + * darwin_specific.m: Darwin specific features ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: darwin_specific.m,v 1.16 2003/11/10 00:49:48 hartman Exp $ + * $Id: darwin_specific.m,v 1.17 2003/12/22 14:32:56 sam Exp $ * - * Authors: Samuel Hocevar + * Authors: Sam Hocevar * Christophe Massiot * * This program 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. - * + * * This program 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 @@ -54,7 +54,7 @@ static int FindLanguage( const char * psz_lang ) "Brazillian Portuguese", "pt_BR", "Russian", "ru", "Swedish", "sv", - NULL + NULL }; for( ppsz_parser = ppsz_all ; ppsz_parser[0] ; ppsz_parser += 2 ) @@ -97,20 +97,20 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; /* Retrieve user's preferences. */ - NSUserDefaults * o_defs = [NSUserDefaults standardUserDefaults]; - NSArray * o_languages = [o_defs objectForKey:@"AppleLanguages"]; - NSEnumerator * o_enumerator = [o_languages objectEnumerator]; + NSUserDefaults * o_defs = [NSUserDefaults standardUserDefaults]; + NSArray * o_languages = [o_defs objectForKey:@"AppleLanguages"]; + NSEnumerator * o_enumerator = [o_languages objectEnumerator]; NSString * o_lang; while ( (o_lang = [o_enumerator nextObject]) ) - { + { const char * psz_string = [o_lang lossyCString]; if ( FindLanguage( psz_string ) ) { break; } } - + [o_pool release]; } } diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c index ea7eb1b938..3de458f821 100644 --- a/src/video_output/video_text.c +++ b/src/video_output/video_text.c @@ -2,15 +2,15 @@ * video_text.c : text manipulation functions ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: video_text.c,v 1.48 2003/12/09 19:15:03 yoann Exp $ + * $Id: video_text.c,v 1.49 2003/12/22 14:32:57 sam Exp $ * - * Authors: Sigmund Augdal + * Author: Sigmund Augdal * * This program 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. - * + * * This program 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 @@ -33,24 +33,24 @@ * \param i_vmargin vertical margin in pixels * \param i_duration Amount of time the text is to be shown. */ -subpicture_t *vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string, - text_style_t *p_style, int i_flags, - int i_hmargin, int i_vmargin, - mtime_t i_duration ) +subpicture_t *vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string, + text_style_t *p_style, int i_flags, + int i_hmargin, int i_vmargin, + mtime_t i_duration ) { subpicture_t *p_subpic = NULL; mtime_t i_now = mdate(); if ( p_vout->pf_add_string ) { - p_subpic = p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, + p_subpic = p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin, i_vmargin, i_now, i_now + i_duration ); } else { - msg_Warn( p_vout, "No text renderer found" ); + msg_Warn( p_vout, "No text renderer found" ); } - + return p_subpic; } @@ -67,26 +67,26 @@ subpicture_t *vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string, * if this is 0 the string will be shown untill the next string * is about to be shown */ -void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string, - text_style_t *p_style, int i_flags, - int i_hmargin, int i_vmargin, mtime_t i_start, - mtime_t i_stop ) +void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string, + text_style_t *p_style, int i_flags, + int i_hmargin, int i_vmargin, mtime_t i_start, + mtime_t i_stop ) { if ( p_vout->pf_add_string ) { - p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin, - i_vmargin, i_start, i_stop ); + p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin, + i_vmargin, i_start, i_stop ); } else { - msg_Warn( p_vout, "No text renderer found" ); + msg_Warn( p_vout, "No text renderer found" ); } } /** * \brief Write an informative message at the default location, - * for the default duration and only if the OSD option is enabled. + * for the default duration and only if the OSD option is enabled. * \param p_caller The object that called the function. * \param psz_string The text to be shown **/ -- 2.39.5