diff options
Diffstat (limited to 'src')
32 files changed, 377 insertions, 497 deletions
| diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 24be52470..2d851b30b 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@   * (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk>   *   *  - * $Id: audio_alsa_out.c,v 1.117 2003/11/07 18:25:35 jcdutton Exp $ + * $Id: audio_alsa_out.c,v 1.118 2003/11/26 23:44:08 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -522,8 +522,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int    /* Check for pause/resume support */    this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params)  			    && snd_pcm_hw_params_can_resume (params) ); -  if (this->class->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); +  xprintf(this->class->xine, XINE_VERBOSITY_LOG, "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume);    this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate;    this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1);    /* @@ -1301,22 +1300,18 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da    this->capabilities = 0; -  if(class->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_alsa_out : supported modes are "); +  xprintf(class->xine, XINE_VERBOSITY_LOG, "audio_alsa_out : supported modes are ");    if (!(snd_pcm_hw_params_test_format(this->audio_fd, params, SND_PCM_FORMAT_U8))) {      this->capabilities |= AO_CAP_8BITS; -    if(class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("8bit "); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "8bit ");    }    if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 1))) {      this->capabilities |= AO_CAP_MODE_MONO; -    if(class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("mono "); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "mono ");    }    if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 2))) {      this->capabilities |= AO_CAP_MODE_STEREO; -    if(class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("stereo "); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "stereo ");    }    if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 4)) &&          config->register_bool (config, @@ -1327,11 +1322,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da                                 0, NULL,                                 NULL) ) {      this->capabilities |= AO_CAP_MODE_4CHANNEL; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("4-channel "); -  } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("(4-channel not enabled in xine config) " ); -  } +    xprintf(class->xine, XINE_VERBOSITY_LOG, "4-channel "); +  }  +  else +    xprintf(class->xine, XINE_VERBOSITY_LOG, "(4-channel not enabled in xine config) "); +      if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&           config->register_bool (config,                                 "audio.four_lfe_channel", @@ -1341,11 +1336,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da                                 0, NULL,                                 NULL) ) {      this->capabilities |= AO_CAP_MODE_4_1CHANNEL; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("4.1-channel "); -  } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("(4.1-channel not enabled in xine config) " ); -  } +    xprintf(class->xine, XINE_VERBOSITY_LOG, "4.1-channel "); +  }  +  else +    xprintf(class->xine, XINE_VERBOSITY_LOG, "(4.1-channel not enabled in xine config) "); +    if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&           config->register_bool (config,                                 "audio.five_channel", @@ -1355,11 +1350,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da                                 0, NULL,                                 NULL) ) {      this->capabilities |= AO_CAP_MODE_5CHANNEL; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("5-channel "); -  } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("(5-channel not enabled in xine config) " ); -  } +    xprintf(class->xine, XINE_VERBOSITY_LOG, "5-channel "); +  }  +  else +    xprintf(class->xine, XINE_VERBOSITY_LOG, "(5-channel not enabled in xine config) "); +    if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&           config->register_bool (config,                                 "audio.five_lfe_channel", @@ -1369,11 +1364,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da                                 0, NULL,                                 NULL) ) {      this->capabilities |= AO_CAP_MODE_5_1CHANNEL; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("5.1-channel "); -  } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("(5.1-channel not enabled in xine config) " ); -  } +    xprintf(class->xine, XINE_VERBOSITY_LOG, "5.1-channel "); +  }  +  else +    xprintf(class->xine, XINE_VERBOSITY_LOG, "(5.1-channel not enabled in xine config) "); +    this->has_pause_resume = 0; /* This is checked at open time instead */ @@ -1407,13 +1402,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da                                 this) ) {      this->capabilities |= AO_CAP_MODE_A52;      this->capabilities |= AO_CAP_MODE_AC5; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("a/52 and DTS pass-through "); -  } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("(a/52 and DTS pass-through not enabled in xine config)"); -  } -  if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("\n"); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "a/52 and DTS pass-through "); +  }  +  else +    xprintf(class->xine, XINE_VERBOSITY_LOG, "(a/52 and DTS pass-through not enabled in xine config)");    /* printf("audio_alsa_out: capabilities 0x%X\n",this->capabilities); */ diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 6f4df2f05..af3d6207a 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: audio_oss_out.c,v 1.93 2003/11/26 19:43:26 f1rmb Exp $ + * $Id: audio_oss_out.c,v 1.94 2003/11/26 23:44:08 f1rmb Exp $   *   * 20-8-2001 First implementation of Audio sync and Audio driver separation.   * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -165,9 +165,8 @@ static int ao_oss_open(ao_driver_t *this_gen,    oss_driver_t *this = (oss_driver_t *) this_gen;    int tmp; -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_oss_out: ao_open rate=%d, mode=%d, dev=%s\n",  -	    rate, mode, this->audio_dev); +  xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_oss_out: ao_open rate=%d, mode=%d, dev=%s\n",  +	  rate, mode, this->audio_dev);    if ( (mode & this->capabilities) == 0 ) {      printf ("audio_oss_out: unsupported mode %08x\n", mode); @@ -218,8 +217,8 @@ static int ao_oss_open(ao_driver_t *this_gen,      tmp = this->input_sample_rate;      if (ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp) == -1) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -	printf ("audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n", this->input_sample_rate); +      xprintf(this->xine, XINE_VERBOSITY_LOG,  +	      "audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n", this->input_sample_rate);        tmp = 44100;        if (ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp) == -1) { @@ -229,9 +228,9 @@ static int ao_oss_open(ao_driver_t *this_gen,      }      this->output_sample_rate = tmp;      this->output_sample_k_rate = this->output_sample_rate / 1000; -    if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("audio_oss_out: audio rate : %d requested, %d provided by device/sec\n", -	      this->input_sample_rate, this->output_sample_rate); +    xprintf(this->xine, XINE_VERBOSITY_LOG, +	    "audio_oss_out: audio rate : %d requested, %d provided by device/sec\n", +	    this->input_sample_rate, this->output_sample_rate);    }    /*     * set number of channels / a52 passthrough @@ -269,13 +268,11 @@ static int ao_oss_open(ao_driver_t *this_gen,      this->num_channels = 2; /* FIXME: is this correct ? */      this->output_sample_rate = this->input_sample_rate;      this->output_sample_k_rate = this->output_sample_rate / 1000; -    if (this->xine->verbosity >= XINE_VERBOSITY_DEBUG) -      printf ("audio_oss_out: AO_CAP_MODE_A52\n"); +    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: AO_CAP_MODE_A52\n");      break;    } -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_oss_out: %d channels output\n",this->num_channels); +  xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_oss_out: %d channels output\n",this->num_channels);    this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8;    /* @@ -703,8 +700,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da     * find best device driver/channel     */ -  if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_oss_out: Opening audio device...\n"); +  xprintf(class->xine, XINE_VERBOSITY_LOG, "audio_oss_out: Opening audio device...\n");    best_rate = 0;    devnum = config->register_num (config, "audio.oss_device_num", -1, @@ -748,9 +744,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da     * open that device     */ -  if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_oss_out: using device >%s<\n", -	    this->audio_dev); +  xprintf(class->xine, XINE_VERBOSITY_LOG, +	  "audio_oss_out: using device >%s<\n", this->audio_dev);    audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK); @@ -789,12 +784,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da       */      if (ioctl(audio_fd, SNDCTL_DSP_GETODELAY, &info) != -1) { -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("audio_oss_out: using SNDCTL_DSP_GETODELAY\n"); +      xprintf(class->xine, XINE_VERBOSITY_LOG, "audio_oss_out: using SNDCTL_DSP_GETODELAY\n");        this->sync_method = OSS_SYNC_GETODELAY;      } else if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) != -1) { -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("audio_oss_out: using SNDCTL_DSP_GETOPTR\n"); +      xprintf(class->xine, XINE_VERBOSITY_LOG, "audio_oss_out: using SNDCTL_DSP_GETOPTR\n");        this->sync_method = OSS_SYNC_GETOPTR;      } else {        this->sync_method = OSS_SYNC_SOFTSYNC; @@ -802,12 +795,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da    }    if (this->sync_method == OSS_SYNC_SOFTSYNC) { -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("audio_oss_out: Audio driver realtime sync disabled...\n"); -      printf ("audio_oss_out: ...will use system real-time clock for soft-sync instead\n"); -      printf ("audio_oss_out: ...there may be audio/video synchronization issues\n"); -    } - +    xprintf(class->xine, XINE_VERBOSITY_LOG, +	    "audio_oss_out: Audio driver realtime sync disabled...\n" +	    "audio_oss_out: ...will use system real-time clock for soft-sync instead\n" +	    "audio_oss_out: ...there may be audio/video synchronization issues\n");      gettimeofday(&this->start_time, NULL);    } @@ -815,10 +806,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da      char *buf;      int c; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("audio_oss_out: Audio driver realtime sync disabled...\n"); -      printf ("audio_oss_out: ...probing output buffer size: "); -    } +    xprintf(class->xine, XINE_VERBOSITY_LOG, +	    "audio_oss_out: Audio driver realtime sync disabled...\n" +	    "audio_oss_out: ...probing output buffer size: ");      this->buffer_size = 0;      if( (buf=malloc(1024)) != NULL ) { @@ -833,10 +823,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da        free(buf);      }      close(audio_fd); -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("%d bytes\n", this->buffer_size ); -      printf ("audio_oss_out: ...there may be audio/video synchronization issues\n"); -    }   +    xprintf(class->xine, XINE_VERBOSITY_LOG, +	    "%d bytes\n" +	    "audio_oss_out: ...there may be audio/video synchronization issues\n", this->buffer_size);      audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK); @@ -870,21 +859,18 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da      return NULL;    } -  if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf ("audio_oss_out: supported modes are "); +  xprintf(class->xine, XINE_VERBOSITY_LOG, "audio_oss_out: supported modes are ");    num_channels = 1;     status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);     if ( (status != -1) && (num_channels==1) ) {      this->capabilities |= AO_CAP_MODE_MONO; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("mono "); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "mono ");    }    num_channels = 2;     status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);     if ( (status != -1) && (num_channels==2) ) {      this->capabilities |= AO_CAP_MODE_STEREO; -    if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("stereo "); +    xprintf(class->xine, XINE_VERBOSITY_LOG, "stereo ");    }    num_channels = 4;     status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);  @@ -893,10 +879,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da  			       _("Enable 4.0 channel analog surround output"),  			       NULL, 0, NULL, NULL)) {        this->capabilities |= AO_CAP_MODE_4CHANNEL; -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf ("4-channel "); -    } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("(4-channel not enabled in xine config) " ); +      xprintf(class->xine, XINE_VERBOSITY_LOG, "4-channel "); +    }  +    else +      xprintf(class->xine, XINE_VERBOSITY_LOG, "(4-channel not enabled in xine config) " );    }    num_channels = 5;     status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);  @@ -905,10 +891,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da  			       _("Enable 5.0 channel analog surround output"),  			       NULL, 0, NULL, NULL)) {        this->capabilities |= AO_CAP_MODE_5CHANNEL; -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf ("5-channel "); -    } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("(5-channel not enabled in xine config) " ); +      xprintf(class->xine, XINE_VERBOSITY_LOG,"5-channel "); +    } +    else +      xprintf(class->xine, XINE_VERBOSITY_LOG, "(5-channel not enabled in xine config) " );    }    num_channels = 6;     status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);  @@ -917,10 +903,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da  			       _("Enable 5.1 channel analog surround output"),  			       NULL, 0, NULL, NULL)) {        this->capabilities |= AO_CAP_MODE_5_1CHANNEL; -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf ("5.1-channel "); -    } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("(5.1-channel not enabled in xine config) " ); +      xprintf(class->xine, XINE_VERBOSITY_LOG, "5.1-channel "); +    }  +    else +      xprintf(class->xine, XINE_VERBOSITY_LOG, "(5.1-channel not enabled in xine config) " );    }    ioctl(audio_fd,SNDCTL_DSP_GETFMTS,&caps); @@ -933,16 +919,12 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da  			       NULL, 0, NULL, NULL)) {        this->capabilities |= AO_CAP_MODE_A52;        this->capabilities |= AO_CAP_MODE_AC5; -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf ("a/52-pass-through "); -    } else  -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf ("(a/52-pass-through not enabled in xine config)"); +      xprintf(class->xine, XINE_VERBOSITY_LOG, "a/52-pass-through "); +    }  +    else  +      xprintf(class->xine, XINE_VERBOSITY_LOG, "(a/52-pass-through not enabled in xine config)");    }     -  if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf ("\n"); -      /*     * mixer initialisation.     */ diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index 07835a455..9e7587398 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: audio_sun_out.c,v 1.30 2003/10/06 15:27:10 mroi Exp $ + * $Id: audio_sun_out.c,v 1.31 2003/11/26 23:44:08 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -412,12 +412,10 @@ static int ao_sun_open(ao_driver_t *this_gen,    int pass;    int ok; -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_sun_out: ao_sun_open rate=%d, mode=%d\n", rate, mode); +  xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: ao_sun_open rate=%d, mode=%d\n", rate, mode);    if ( (mode & this->capabilities) == 0 ) { -    if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf ("audio_sun_out: unsupported mode %08x\n", mode); +    xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: unsupported mode %08x\n", mode);      return 0;    } @@ -544,8 +542,7 @@ static int ao_sun_open(ao_driver_t *this_gen,  	   this->input_sample_rate, this->output_sample_rate);    */ -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_sun_out: %d channels output\n",this->num_channels); +  xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: %d channels output\n",this->num_channels);    return this->output_sample_rate;  } @@ -894,8 +891,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v     * find best device driver/channel     */ -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("audio_sun_out: Opening audio device %s...\n", devname); +  xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: Opening audio device %s...\n", devname);    /*     * open the device diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 76a24e4e4..0036fdbe9 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: demux_asf.c,v 1.143 2003/11/26 19:43:27 f1rmb Exp $ + * $Id: demux_asf.c,v 1.144 2003/11/26 23:44:09 f1rmb Exp $   *   * demultiplexer for asf streams   * @@ -184,8 +184,7 @@ static uint8_t get_byte (demux_asf_t *this) {    /* printf ("%02x ", buf); */    if (i != 1) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: end of data\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: end of data\n");      this->status = DEMUX_FINISHED;    } @@ -202,8 +201,7 @@ static uint16_t get_le16 (demux_asf_t *this) {    /* printf (" [%02x %02x] ", buf[0], buf[1]); */    if (i != 2) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: end of data\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: end of data\n");      this->status = DEMUX_FINISHED;    } @@ -220,8 +218,7 @@ static uint32_t get_le32 (demux_asf_t *this) {    /* printf ("%02x %02x %02x %02x ", buf[0], buf[1], buf[2], buf[3]); */    if (i != 4) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: end of data\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: end of data\n");      this->status = DEMUX_FINISHED;    } @@ -236,8 +233,7 @@ static uint64_t get_le64 (demux_asf_t *this) {    i = this->input->read (this->input, buf, 8);    if (i != 8) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: end of data\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: end of data\n");      this->status = DEMUX_FINISHED;    } @@ -254,11 +250,12 @@ static int get_guid_id (demux_asf_t *this, GUID g) {      }    } -  if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -    printf ("demux_asf: unknown GUID: 0x%x, 0x%x, 0x%x, " -	    "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", -	    g.Data1, g.Data2, g.Data3, -	    g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7]); +  xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, +	  "demux_asf: unknown GUID: 0x%x, 0x%x, 0x%x, " +	  "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", +	  g.Data1, g.Data2, g.Data3, +	  g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7]); +    return GUID_ERROR;  } @@ -460,9 +457,9 @@ static int asf_read_header (demux_asf_t *this) {                this->reorder_w = (buffer[2]<<8)|buffer[1];                this->reorder_b = (buffer[4]<<8)|buffer[3];                this->reorder_w /= this->reorder_b; -	      if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -		printf ("demux_asf: audio conceal interleave detected (%d x %d x %d)\n", -			this->reorder_w, this->reorder_h, this->reorder_b ); +	      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,  +		      "demux_asf: audio conceal interleave detected (%d x %d x %d)\n", +		      this->reorder_w, this->reorder_h, this->reorder_b );              } else {                this->reorder_b=this->reorder_h=this->reorder_w=1;              } @@ -626,8 +623,7 @@ static int demux_asf_send_headers_common (demux_asf_t *this, int send_ctrl_start    if (!asf_read_header (this)) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: asf_read_header failed.\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: asf_read_header failed.\n");      this->status = DEMUX_FINISHED;      return 1; @@ -655,9 +651,9 @@ static int demux_asf_send_headers_common (demux_asf_t *this, int send_ctrl_start        stream_id  = this->streams[i].stream_id;        bitrate    = this->bitrates[stream_id]; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -        printf("demux_asf: stream: %d, bitrate %d bps\n", stream_id, bitrate); - +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, +	      "demux_asf: stream: %d, bitrate %d bps\n", stream_id, bitrate); +              if ((buf_type == BUF_VIDEO_BASE) &&            (bitrate > max_vrate || this->video_stream_id == -1)) { @@ -683,9 +679,8 @@ static int demux_asf_send_headers_common (demux_asf_t *this, int send_ctrl_start      _x_stream_info_set(this->stream, XINE_STREAM_INFO_BITRATE, bitrate); -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf("demux_asf: video stream_id: %d, audio stream_id: %d\n", -             this->video_stream_id, this->audio_stream_id); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: video stream_id: %d, audio stream_id: %d\n", +	    this->video_stream_id, this->audio_stream_id);      if(_x_stream_info_get(this->stream, XINE_STREAM_INFO_HAS_AUDIO))        asf_send_audio_header(this, this->audio_stream); @@ -1015,8 +1010,7 @@ static int asf_parse_packet_header(demux_asf_t *this) {          g.Data4[i] = get_byte(this);        }        if (get_guid_id(this, g) == GUID_ASF_HEADER) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -          printf("demux_asf: new asf header detected\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "demux_asf: new asf header detected\n");          if (demux_asf_send_headers_common(this, 0))            return 1;          invalid_packet = 1; @@ -1099,8 +1093,7 @@ static int asf_parse_packet_header(demux_asf_t *this) {    if (this->packet_padsize > this->packet_size) {      /* skip packet */ -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -      printf ("demux_asf: invalid padsize: %d\n", this->packet_padsize); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: invalid padsize: %d\n", this->packet_padsize);      return 1;    } @@ -1238,8 +1231,7 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,    if (*rlen > this->packet_size_left) {      /* skip packet */ -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: invalid rlen %d\n", *rlen); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: invalid rlen %d\n", *rlen);      return 1;    } @@ -1291,8 +1283,7 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,    if (data_length > this->packet_size_left) {      /* skip packet */ -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: invalid data_length\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: invalid data_length\n");      return 1;    } @@ -1306,14 +1297,12 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,      if (stream && stream->fifo) {        /* keyframe detection for non-seekable input plugins */        if (stream->skip && (raw_id & 0x80) && !this->keyframe_ts) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -          printf ("demux_asf: keyframe detected\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: keyframe detected\n");          this->keyframe_ts = 1;        }        if (stream->resync && (*timestamp >= this->keyframe_ts) && (this->keyframe_ts)) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -          printf ("demux_asf: stream resynced\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: stream resynced\n");          stream->resync = 0;          stream->skip = 0;        } @@ -1365,8 +1354,7 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,      if (rlen - 8) this->input->seek (this->input, rlen - 8, SEEK_CUR);      s_hdr_size += rlen - 8;    } else { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: strange rlen %d\n", rlen); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: strange rlen %d\n", rlen);      *timestamp   = 0;      payload_size = 0;      if (rlen) this->input->seek (this->input, rlen, SEEK_CUR); @@ -1396,8 +1384,7 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,    if (frag_len > this->packet_size_left) {      /* skip packet */ -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: invalid frag_len %d\n", frag_len); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: invalid frag_len %d\n", frag_len);      return 1;    } @@ -1411,14 +1398,12 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,      if (!frag_offset) {        /* keyframe detection for non-seekable input plugins */        if (stream->skip && (raw_id & 0x80) && !this->keyframe_ts) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -          printf ("demux_asf: keyframe detected\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: keyframe detected\n");          this->keyframe_ts = 1;        }        if (stream->resync && (*timestamp >= this->keyframe_ts) &&            this->keyframe_ts && !frag_offset) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -          printf ("demux_asf: stream resynced\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: stream resynced\n");          stream->resync = 0;          stream->skip = 0;        } @@ -1511,8 +1496,7 @@ static int demux_asf_parse_http_references( demux_asf_t *this) {        memcpy(href, "mmsh", 4);      } -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf("demux_asf: http ref: %s\n", href); +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "demux_asf: http ref: %s\n", href);      uevent.type = XINE_EVENT_MRL_REFERENCE;      uevent.stream = this->stream;      uevent.data_length = strlen(href) + sizeof(xine_mrl_reference_data_t); @@ -1578,8 +1562,7 @@ static int demux_asf_parse_asf_references( demux_asf_t *this) {        }      } -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf("demux_asf: asf ref: %s\n", ptr); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: asf ref: %s\n", ptr);      uevent.type = XINE_EVENT_MRL_REFERENCE;      uevent.stream = this->stream;      uevent.data_length = strlen(ptr) + sizeof(xine_mrl_reference_data_t); @@ -1741,8 +1724,7 @@ static int demux_asf_send_chunk (demux_plugin_t *this_gen) {        if (asf_parse_packet_header(this)) { -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -          printf ("demux_asf: get_packet failed\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: get_packet failed\n");          this->status = DEMUX_FINISHED;          return this->status;        } @@ -1811,8 +1793,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {    guid = get_guid(this);    if (guid != GUID_ASF_HEADER) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -      printf ("demux_asf: file doesn't start with an asf header\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: file doesn't start with an asf header\n");      this->status = DEMUX_FINISHED;      return;    } @@ -1958,8 +1939,7 @@ static int demux_asf_seek (demux_plugin_t *this_gen,        start_pos -= this->packet_size;      }      if (state != 5) { -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -        printf ("demux_asf: demux_asf_seek: begining of the stream\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: demux_asf_seek: begining of the stream\n");        this->input->seek (this->input, this->first_packet_pos, SEEK_SET);      } else {        this->input->seek (this->input, start_pos + this->packet_size, SEEK_SET); diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index d9faf7011..43d09f906 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -19,7 +19,7 @@   */  /* - * $Id: demux_avi.c,v 1.182 2003/11/26 19:43:28 f1rmb Exp $ + * $Id: demux_avi.c,v 1.183 2003/11/26 23:44:09 f1rmb Exp $   *   * demultiplexer for avi streams   * @@ -684,8 +684,7 @@ static avi_t *AVI_init(demux_avi_t *this) {      this->idx_grow.nexttagoffset = this->input->get_current_pos(this->input);      if (this->input->read(this->input, data,8) != 8 ) { -      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, -	      "failed to read 8 bytes at pos %lld\n", +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "failed to read 8 bytes at pos %lld\n",                this->idx_grow.nexttagoffset);        break; /* We assume it's EOF */      } @@ -695,8 +694,7 @@ static avi_t *AVI_init(demux_avi_t *this) {      next_chunk = this->idx_grow.nexttagoffset + 8 + n;      if (n == 0) { -      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, -	      "invalid chunk length (0 byte)\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "invalid chunk length (0 byte)\n");        break;      } @@ -1504,7 +1502,7 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) {      for (i=0; i < this->avi->n_audio; i++) -      printf ("demux_avi: audio format[%d] = 0x%x\n", +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_avi: audio format[%d] = 0x%x\n",  	      i, this->avi->audio[i]->wavex->wFormatTag);    }    this->no_audio = 0; @@ -1513,14 +1511,12 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {      this->avi->audio[i]->audio_type = _x_formattag_to_buf_audio (this->avi->audio[i]->wavex->wFormatTag);      if( !this->avi->audio[i]->audio_type ) { -      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -               "unknown audio type 0x%x\n", +      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "unknown audio type 0x%x\n",  	       this->avi->audio[i]->wavex->wFormatTag);        this->no_audio  = 1;        this->avi->audio[i]->audio_type     = BUF_AUDIO_UNKNOWN;      } else -      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -               "demux_avi: audio type %s (wFormatTag 0x%x)\n", +      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_avi: audio type %s (wFormatTag 0x%x)\n",                 _x_buf_audio_name(this->avi->audio[i]->audio_type),                 (int)this->avi->audio[i]->wavex->wFormatTag);    } @@ -1554,15 +1550,13 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {                           this->avi->compressor);      if (!this->avi->video_type) { -      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -               "demux_avi: unknown video codec '%.4s'\n", +      xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_avi: unknown video codec '%.4s'\n",                 (char*)&this->avi->bih->biCompression);        this->avi->video_type = BUF_VIDEO_UNKNOWN;      }      buf->type = this->avi->video_type; -    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -             "demux_avi: video codec is '%s'\n", +    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_avi: video codec is '%s'\n",               _x_buf_video_name(buf->type));      this->video_fifo->put (this->video_fifo, buf); @@ -1657,7 +1651,7 @@ static int demux_avi_seek_internal (demux_avi_t *this) {     */    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -           "start pos is %lld, start time is %d\n",start_pos, start_time); +	   "start pos is %lld, start time is %d\n",start_pos, start_time);    /* Seek video.  We do a single idx_grow at the beginning rather than     * incrementally growing the index in a loop, so that if the index @@ -1723,8 +1717,7 @@ static int demux_avi_seek_internal (demux_avi_t *this) {     * position we've already found, so we won't be seeking though the     * file much at this point. */ -  if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -    lprintf ("video_pts = %lld\n", video_pts); +  xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "video_pts = %lld\n", video_pts);    /* FIXME ? */    audio_pts = 77777777; diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c index 36a56334c..eb89c1b01 100644 --- a/src/demuxers/demux_nsf.c +++ b/src/demuxers/demux_nsf.c @@ -30,7 +30,7 @@   * For more information regarding the NSF format, visit:   *   http://www.tripoint.org/kevtris/nes/nsfspec.txt   * - * $Id: demux_nsf.c,v 1.19 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_nsf.c,v 1.20 2003/11/26 23:44:09 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -298,8 +298,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str    demux_nsf_t   *this;    if (!INPUT_IS_SEEKABLE(input)) { -    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, -            _("input not seekable, can not handle!\n")); +    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");      return NULL;    } diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 68b4bfd86..ea5d5f7ba 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -19,7 +19,7 @@   */  /* - * $Id: demux_ogg.c,v 1.117 2003/11/26 19:43:30 f1rmb Exp $ + * $Id: demux_ogg.c,v 1.118 2003/11/26 23:44:09 f1rmb Exp $   *   * demultiplexer for ogg streams   * @@ -727,8 +727,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) {      } else {        stream_num = get_stream(this, cur_serno);        if (stream_num == -1) { -	xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                 "help, stream with no beginning!\n"); +	xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "help, stream with no beginning!\n");  	abort();        }      } @@ -818,8 +817,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) {  	    this->preview_buffers[stream_num] += header->extra_headers;  	  }  #else -	  xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                   "Speex stream detected, unable to play\n"); +	  xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Speex stream detected, unable to play\n");  	  this->buf_types[stream_num] = BUF_CONTROL_NOP;  #endif @@ -951,8 +949,8 @@ static void demux_ogg_send_header (demux_ogg_t *this) {  	      this->buf_types[stream_num] = BUF_AUDIO_A52 | channel;  	      break;  	    default: -              xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                       "demux_ogg: unknown audio codec type 0x%x\n", codec); +              xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,  +		       "demux_ogg: unknown audio codec type 0x%x\n", codec);  	      this->buf_types[stream_num] = BUF_CONTROL_NOP;  	      break;  	    } @@ -1099,9 +1097,8 @@ static void demux_ogg_send_header (demux_ogg_t *this) {  #endif -	    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                     "FIXME, old audio format not handled\n"); - +	    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "FIXME, old audio format not handled\n"); +	      	    this->buf_types[stream_num] = BUF_CONTROL_NOP;  	  } else { @@ -1168,7 +1165,7 @@ static void demux_ogg_send_header (demux_ogg_t *this) {  	  } else {  	    /*Rejected stream*/  	    xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                     " A theora header was rejected by libtheora\n"); +                     "A theora header was rejected by libtheora\n");  	    this->buf_types[stream_num] = BUF_CONTROL_NOP;  	    this->preview_buffers[stream_num] = 5; /* FIXME: don't know */  	  } @@ -1178,10 +1175,12 @@ static void demux_ogg_send_header (demux_ogg_t *this) {  #endif  	} else { -          if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG){ -            printf ("demux_ogg: unknown stream type (signature >%.8s<). hex dump of bos packet follows:\n", op.packet); +          xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, +		  "demux_ogg: unknown stream type (signature >%.8s<). hex dump of bos packet follows:\n", +		  op.packet); +	  if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)              xine_hexdump (op.packet, op.bytes); -          } +  	  this->buf_types[stream_num] = BUF_CONTROL_NOP;  	}        } @@ -1318,7 +1317,7 @@ static void demux_ogg_send_content (demux_ogg_t *this) {  	  iframe=op.granulepos>>keyframe_granule_shift;  	  pframe=op.granulepos-(iframe<<keyframe_granule_shift);            xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, -                   "seeking keyframe i %lld p %lld\n",iframe,pframe); +                   "seeking keyframe i %lld p %lld\n", iframe, pframe);  	  if (pframe!=0)  	    continue;  	} else diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c index a6040ca6d..fcd87e403 100644 --- a/src/demuxers/demux_pva.c +++ b/src/demuxers/demux_pva.c @@ -23,7 +23,7 @@   * For more information regarding the PVA file format, refer to this PDF:   *   http://www.technotrend.de/download/av_format_v1.pdf   * - * $Id: demux_pva.c,v 1.15 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_pva.c,v 1.16 2003/11/26 23:44:09 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -419,8 +419,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str    demux_pva_t    *this;    if (!INPUT_IS_SEEKABLE(input)) { -    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, -            _("input not seekable, can not handle!\n")); +    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");      return NULL;    } diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index 299f9ddc7..13672c88d 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -23,7 +23,7 @@   * For more information regarding the RoQ file format, visit:   *   http://www.csse.monash.edu.au/~timf/   * - * $Id: demux_roq.c,v 1.48 2003/11/26 19:43:30 f1rmb Exp $ + * $Id: demux_roq.c,v 1.49 2003/11/26 23:44:09 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -404,8 +404,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str    demux_roq_t    *this;    if (!INPUT_IS_SEEKABLE(input)) { -    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, -            _("input not seekable, can not handle!\n")); +    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");      return NULL;    } diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index fea38c122..3734e18d0 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -23,7 +23,7 @@   * For more information on the SMJPEG file format, visit:   *   http://www.lokigames.com/development/smjpeg.php3   * - * $Id: demux_smjpeg.c,v 1.46 2003/11/16 23:33:43 f1rmb Exp $ + * $Id: demux_smjpeg.c,v 1.47 2003/11/26 23:44:09 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -398,8 +398,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str    demux_smjpeg_t *this;    if (!INPUT_IS_SEEKABLE(input)) { -    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, -            _("input not seekable, can not handle!\n")); +    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");      return NULL;    } diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 3d69d6cd6..b4f291906 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -24,7 +24,7 @@   * This demuxer handles either raw STR files (which are just a concatenation   * of raw compact disc sectors) or STR files with RIFF headers.   * - * $Id: demux_str.c,v 1.21 2003/11/26 19:43:31 f1rmb Exp $ + * $Id: demux_str.c,v 1.22 2003/11/26 23:44:09 f1rmb Exp $   */  /* @@ -549,8 +549,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str    demux_str_t    *this;    if (!INPUT_IS_SEEKABLE(input)) { -    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, -      _("input not seekable, can not handle!\n")); +    xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");      return NULL;    } diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index e0db85f29..ded0a5624 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: dxr3_decode_video.c,v 1.45 2003/11/16 23:33:44 f1rmb Exp $ + * $Id: dxr3_decode_video.c,v 1.46 2003/11/26 23:44:09 f1rmb Exp $   */  /* dxr3 video decoder plugin. @@ -556,13 +556,13 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)          printf("dxr3_decode_video: set video pts failed (%s)\n",            strerror(errno));      } -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) { -      if (delay >= 90000)   /* frame more than 1 sec ahead */ -	printf("dxr3_decode_video: WARNING: vpts %lld is %.02f seconds ahead of time!\n", -	  vpts, delay/90000.0);  -      if (delay < 0) -	printf("dxr3_decode_video: WARNING: overdue frame.\n"); -    } +     +    if (delay >= 90000)   /* frame more than 1 sec ahead */ +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, +	      "dxr3_decode_video: WARNING: vpts %lld is %.02f seconds ahead of time!\n", +	      vpts, delay/90000.0); +    if (delay < 0) +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "dxr3_decode_video: WARNING: overdue frame.\n");    }  #if LOG_PTS    else if (buf->pts) { diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index 5f559d537..695ce0890 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: video_out_dxr3.c,v 1.92 2003/11/26 20:30:36 mroi Exp $ + * $Id: video_out_dxr3.c,v 1.93 2003/11/26 23:44:09 f1rmb Exp $   */  /* mpeg1 encoding video out plugin for the dxr3.   @@ -285,9 +285,9 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v  #endif    if ((this->fd_control = open(tmpstr, O_WRONLY)) < 0) { -      if (class->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("video_out_dxr3: Failed to open control device %s (%s)\n", -	       tmpstr, strerror(errno)); +    xprintf(class->xine, XINE_VERBOSITY_LOG, +	    "video_out_dxr3: Failed to open control device %s (%s)\n", tmpstr, strerror(errno)); +      return 0;    } diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 01f8ed89a..291ae37ea 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: input_dvd.c,v 1.173 2003/11/16 23:33:44 f1rmb Exp $ + * $Id: input_dvd.c,v 1.174 2003/11/26 23:44:09 f1rmb Exp $   *   */ @@ -1376,8 +1376,7 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {        this->opened = 0;         ret = dvdnav_open(&this->dvdnav, intended_dvd_device);        if(ret == DVDNAV_STATUS_ERR) { -	if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -	  printf("input_dvd: Error opening DVD device\n"); +	xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "input_dvd: Error opening DVD device\n");  	_x_message (this->stream, XINE_MSG_READ_ERROR,  		      intended_dvd_device, NULL);          return 0; @@ -1388,8 +1387,7 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {    } else {      ret = dvdnav_open(&this->dvdnav, intended_dvd_device);      if(ret == DVDNAV_STATUS_ERR) { -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("input_dvd: Error opening DVD device\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "input_dvd: Error opening DVD device\n");        _x_message (this->stream, XINE_MSG_READ_ERROR,  		    intended_dvd_device, NULL);        return 0; @@ -1727,6 +1725,9 @@ static void *init_class (xine_t *xine, void *data) {  /*   * $Log: input_dvd.c,v $ + * Revision 1.174  2003/11/26 23:44:09  f1rmb + * xprintf clean pass. xprintf now log into new XINE_LOG_TRACE log buffer. scratch buffer enhancement (thanks Thibaut for the malloc tips), enlarge log buffer from 25 lines (very useless), to 150 (better). + *   * Revision 1.173  2003/11/16 23:33:44  f1rmb   * New stream/meta info (safe) stuff.   * BIG NOTE: use helpers to access to these informations (get/set/reset): diff --git a/src/input/input_mms.c b/src/input/input_mms.c index faa0933fd..76ada3774 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: input_mms.c,v 1.42 2003/11/26 19:43:31 f1rmb Exp $ + * $Id: input_mms.c,v 1.43 2003/11/26 23:44:09 f1rmb Exp $   *   * mms input plugin based on work from major mms   */ @@ -35,7 +35,6 @@  #include <sys/types.h>  #include <sys/stat.h>  #include <fcntl.h> -#include "bswap.h"  #define LOG_MODULE "input_mms"  #define LOG_VERBOSE @@ -43,6 +42,7 @@  #define LOG  */ +#include "bswap.h"  #include "xine_internal.h"  #include "xineutils.h"  #include "input_plugin.h" diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 94f6e6ad1..2ccfc397a 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -665,9 +665,8 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)        }        if (strstr(this->video_channel.name, input_source) == NULL) { -	 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	    PRINT("Tuner name not found\n"); -	 return -1; +	xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "Tuner name not found\n"); +	return -1;        }        this->tuner_name = input_source; @@ -1189,9 +1188,9 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi        /* Buffer is empty, and we did not pause playback */        report_progress(this->stream, SCR_PAUSED); -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	 PRINT("Buffer is empty, pausing playback (used: %d, num_free: %d)\r\n", -	    num_used, num_free); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG,  +	      "Buffer is empty, pausing playback (used: %d, num_free: %d)\r\n", +	      num_used, num_free);        this->stream->xine->clock->set_speed (this->stream->xine->clock, XINE_SPEED_PAUSE);        this->stream->xine->clock->set_option (this->stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 0); @@ -1211,9 +1210,8 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi     if (scr_tunning == SCR_PAUSED) {        if (2 * num_used > num_free) {  	 /* Playback was paused, but we have normal buffer usage again */ -	 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	    PRINT("Resuming playback (used: %d, free: %d)\r\n", -	       num_used, num_free); +	xprintf(this->stream->xine, XINE_VERBOSITY_LOG, +		"Resuming playback (used: %d, free: %d)\r\n", num_used, num_free);  	 this->scr_tunning = 0; @@ -1251,8 +1249,8 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi        /* Check if speed adjustment should be changed */         if (scr_tunning != this->scr_tunning) {  	 this->scr_tunning = scr_tunning; -	 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	    PRINT("scr tunning = %d (used: %d, free: %d)\r\n", scr_tunning, num_used, num_free); +	 xprintf(this->stream->xine, XINE_VERBOSITY_LOG,  +		 "scr tunning = %d (used: %d, free: %d)\r\n", scr_tunning, num_used, num_free);  	 pvrscr_speed_tunning(this->scr, 1.0 + (0.01 * scr_tunning));        }     } else @@ -1263,8 +1261,8 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi         */        this->scr_tunning = 0; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	 PRINT("scr tunning resetting (used: %d, free: %d\r\n", num_used, num_free); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, +	      "scr tunning resetting (used: %d, free: %d\r\n", num_used, num_free);        pvrscr_speed_tunning(this->scr, 1.0);     } diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index 7462b0793..bb8970e81 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -237,8 +237,7 @@ static void nbc_alloc_cb (fifo_buffer_t *fifo, void *this_gen) {        report_progress (this->stream, 100);        this->buffering = 0; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -        printf("\nnet_buf_ctrl: nbc_alloc_cb: stops buffering\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "\nnet_buf_ctrl: nbc_alloc_cb: stops buffering\n");        nbc_set_speed_normal(this->stream);      } @@ -262,8 +261,7 @@ static void nbc_put_cb (fifo_buffer_t *fifo,      /* do nothing if we are at the end of the stream */      if (!this->enabled) {        /* a new stream starts */ -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -        printf("\nnet_buf_ctrl: nbc_put_cb: starts buffering\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "\nnet_buf_ctrl: nbc_put_cb: starts buffering\n");        this->enabled           = 1;        this->buffering         = 1;        this->video_first_pts   = 0; @@ -299,8 +297,7 @@ static void nbc_put_cb (fifo_buffer_t *fifo,          report_progress (this->stream, 100);          this->buffering = 0; -        if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -          printf("\nnet_buf_ctrl: nbc_put_cb: stops buffering\n"); +        xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "\nnet_buf_ctrl: nbc_put_cb: stops buffering\n");          nbc_set_speed_normal(this->stream); @@ -353,8 +350,7 @@ static void nbc_put_cb (fifo_buffer_t *fifo,              this->progress = 100;              report_progress (this->stream, this->progress); -            if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -              printf("\nnet_buf_ctrl: nbc_put_cb: stops buffering\n"); +            xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "\nnet_buf_ctrl: nbc_put_cb: stops buffering\n");              nbc_set_speed_normal(this->stream);            } @@ -427,9 +423,9 @@ static void nbc_get_cb (fifo_buffer_t *fifo,              this->progress  = 0;              report_progress (this->stream, 0); -            if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -              printf("\nnet_buf_ctrl: nbc_get_cb: starts buffering, vid: %d, aud: %d\n", -                     this->video_fifo_fill, this->audio_fifo_fill); +            xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,  +		    "\nnet_buf_ctrl: nbc_get_cb: starts buffering, vid: %d, aud: %d\n", +		    this->video_fifo_fill, this->audio_fifo_fill);              nbc_set_speed_pause(this->stream);            }          } diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 3a119d959..3d6ab0692 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: xine_decoder.c,v 1.140 2003/11/26 19:43:32 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.141 2003/11/26 23:44:10 f1rmb Exp $   *   * xine decoder plugin using ffmpeg   * @@ -157,8 +157,7 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){    if( (this->context->pix_fmt != PIX_FMT_YUV420P) ||        (width != context->width) || (height != context->height) ) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf("ffmpeg: unsupported frame format, DR1 disabled.\n"); +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "ffmpeg: unsupported frame format, DR1 disabled.\n");      this->context->get_buffer = avcodec_default_get_buffer;      this->context->release_buffer = avcodec_default_release_buffer; @@ -287,8 +286,7 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) {          this->codec->capabilities & CODEC_CAP_DR1 ) {        this->context->get_buffer = get_buffer;        this->context->release_buffer = release_buffer; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("ffmpeg: direct rendering enabled\n"); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "ffmpeg: direct rendering enabled\n");      }  #endif    } @@ -955,9 +953,9 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {      if( this->size + buf->size > this->bufsize ) {        this->bufsize = this->size + 2 * buf->size; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("ffmpeg: increasing source buffer to %d to avoid overflow.\n",  -               this->bufsize); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG,  +	      "ffmpeg: increasing source buffer to %d to avoid overflow.\n",  +	      this->bufsize);        this->buf = realloc( this->buf, this->bufsize );      } @@ -1029,9 +1027,8 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {  	offset += len;  	if (!got_picture || !this->av_frame->data[0]) { -	  if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	    printf ("ffmpeg: didn't get a picture, got %d bytes left\n", -		    this->size); +	  xprintf(this->stream->xine, XINE_VERBOSITY_LOG,  +		  "ffmpeg: didn't get a picture, got %d bytes left\n", this->size);  	  if (this->size>0)  	    memmove (this->buf, &this->buf[offset], this->size); @@ -1507,9 +1504,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)      if( this->size + buf->size > this->bufsize ) {        this->bufsize = this->size + 2 * buf->size; -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("ffmpeg: increasing source buffer to %d to avoid overflow.\n", -               this->bufsize); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, +	      "ffmpeg: increasing source buffer to %d to avoid overflow.\n", this->bufsize);        this->buf = realloc( this->buf, this->bufsize );      } diff --git a/src/libtheora/xine_decoder.c b/src/libtheora/xine_decoder.c index be22c34be..cce78fb84 100644 --- a/src/libtheora/xine_decoder.c +++ b/src/libtheora/xine_decoder.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: xine_decoder.c,v 1.15 2003/11/26 19:43:36 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.16 2003/11/26 23:44:10 f1rmb Exp $   *   * xine decoder plugin using libtheora   * @@ -229,8 +229,7 @@ static void theora_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {      ret=theora_decode_packetin( &this->t_state, &this->op);      if ( ret!=0) { -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -	printf ("libtheora:Received an bad packet\n"); +      xprintf(this->stream, XINE_VERBOSITY_LOG, "libtheora:Received an bad packet\n");      } else if (!this->skipframes) {        theora_decode_YUVout(&this->t_state,&yuv); diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index bb4baf299..1531dcb4d 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: video_out_vidix.c,v 1.54 2003/11/26 19:43:37 f1rmb Exp $ + * $Id: video_out_vidix.c,v 1.55 2003/11/26 23:44:10 f1rmb Exp $   *    * video_out_vidix.c   * @@ -755,8 +755,7 @@ static int vidix_set_property (vo_driver_t *this_gen,      this->vidix_eq.hue = value;      if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq)) != 0) -      if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("video_out_vidix: can't set hue: %s\n", strerror(err)); +      xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: can't set hue: %s\n", strerror(err));    }    if ( property == VO_PROP_SATURATION ) { @@ -764,8 +763,7 @@ static int vidix_set_property (vo_driver_t *this_gen,      this->vidix_eq.saturation = value;      if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq)) != 0) -      if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("video_out_vidix: can't set saturation: %s\n", strerror(err)); +      xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: can't set saturation: %s\n", strerror(err));    }    if ( property == VO_PROP_BRIGHTNESS ) { @@ -773,8 +771,7 @@ static int vidix_set_property (vo_driver_t *this_gen,      this->vidix_eq.brightness = value;      if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq)) != 0) -      if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("video_out_vidix: can't set brightness: %s\n", strerror(err)); +      xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: can't set brightness: %s\n", strerror(err));    }    if ( property == VO_PROP_CONTRAST ) { @@ -782,8 +779,7 @@ static int vidix_set_property (vo_driver_t *this_gen,      this->vidix_eq.contrast = value;      if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq)) != 0) -      if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("video_out_vidix: can't set contrast: %s\n", strerror(err)); +      xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: can't set contrast: %s\n", strerror(err));    }    } @@ -836,8 +832,7 @@ static void vidix_rgb_callback(vo_driver_t *this_gen, xine_cfg_entry_t *entry) {    }      if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq))) -    if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf("video_out_vidix: can't set rgb intensity: %s\n", strerror(err)); +    xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: can't set rgb intensity: %s\n", strerror(err));  } @@ -964,8 +959,8 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) {    /* Find what equalizer flags are supported */    if(this->vidix_cap.flags & FLAG_EQUALIZER) {      if((err = vdlPlaybackGetEq(this->vidix_handler, &this->vidix_eq)) != 0) { -      if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("video_out_vidix: couldn't get equalizer capabilities: %s\n", strerror(err)); +      xprintf(this->xine, XINE_VERBOSITY_LOG,  +	      "video_out_vidix: couldn't get equalizer capabilities: %s\n", strerror(err));      } else {        if(this->vidix_eq.cap & VEQ_CAP_BRIGHTNESS) {          this->props[VO_PROP_BRIGHTNESS].value = 0; @@ -1008,9 +1003,8 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) {            (void*) vidix_rgb_callback, this);         if((err = vdlPlaybackSetEq(this->vidix_handler, &this->vidix_eq))) -         if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -           printf("video_out_vidix: can't set rgb intensity: %s\n",  -                  strerror(err)); +         xprintf(this->xine, XINE_VERBOSITY_LOG,  +		 "video_out_vidix: can't set rgb intensity: %s\n", strerror(err));        }            }    } @@ -1061,8 +1055,7 @@ static void query_fourccs (vidix_driver_t *this) {    if((err = vdlQueryFourcc(this->vidix_handler, &vidix_fourcc)) == 0) {      this->capabilities |= VO_CAP_YUY2; -    if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf("video_out_vidix: adaptor supports the yuy2 format\n"); +    xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: adaptor supports the yuy2 format\n");    }    /* Detect if YV12 is supported - we always support yv12 but we need @@ -1072,8 +1065,7 @@ static void query_fourccs (vidix_driver_t *this) {    if((err = vdlQueryFourcc(this->vidix_handler, &vidix_fourcc)) == 0) {      this->supports_yv12 = 1; -    if(this->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf("video_out_vidix: adaptor supports the yv12 format\n"); +    xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_vidix: adaptor supports the yv12 format\n");    } else      this->supports_yv12 = 0;  } @@ -1110,9 +1102,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {      free(this);      return NULL;    } -  if(xine->verbosity >= XINE_VERBOSITY_LOG) -    printf("video_out_vidix: using driver: %s by %s\n",this->vidix_cap.name,this->vidix_cap.author); +  xprintf(xine, XINE_VERBOSITY_LOG,  +	  "video_out_vidix: using driver: %s by %s\n",this->vidix_cap.name,this->vidix_cap.author);    this->xine              = xine;    this->config            = xine->config; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 4cde70123..86e81593d 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: video_out_xshm.c,v 1.122 2003/11/26 19:43:37 f1rmb Exp $ + * $Id: video_out_xshm.c,v 1.123 2003/11/26 23:44:10 f1rmb Exp $   *    * video_out_xshm.c, X11 shared memory extension interface for xine   * @@ -184,10 +184,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,  			      height);      if (myimage == NULL )  { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf ("video_out_xshm: shared memory error when allocating image\n"); -	printf ("video_out_xshm: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xshm: shared memory error when allocating image\n" +	      "video_out_xshm: => not using MIT Shared Memory extension.\n");        this->use_shm = 0;        goto finishShmTesting;      } @@ -201,10 +200,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,  			  IPC_CREAT | 0777);      if (shminfo->shmid < 0 ) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf ("video_out_xshm: %s: allocating image\n",strerror(errno)); -	printf ("video_out_xshm: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xshm: %s: allocating image\n" +	      "video_out_xshm: => not using MIT Shared Memory extension.\n", strerror(errno));        this->use_shm = 0;        goto finishShmTesting;      } @@ -212,10 +210,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,      shminfo->shmaddr  = (char *) shmat(shminfo->shmid, 0, 0);      if (shminfo->shmaddr == ((char *) -1)) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf ("video_out_xshm: shared memory error (address error) when allocating image \n"); -	printf ("video_out_xshm: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xshm: shared memory error (address error) when allocating image \n" +	      "video_out_xshm: => not using MIT Shared Memory extension.\n");        shmctl (shminfo->shmid, IPC_RMID, 0);        shminfo->shmid = -1;        this->use_shm = 0; @@ -230,10 +227,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,      XSync(this->display, False);      if (gX11Fail) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf ("video_out_xshm: x11 error during shared memory XImage creation\n"); -	printf ("video_out_xshm: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xshm: x11 error during shared memory XImage creation\n" +	      "video_out_xshm: => not using MIT Shared Memory extension.\n");        shmdt (shminfo->shmaddr);        shmctl (shminfo->shmid, IPC_RMID, 0);        shminfo->shmid = -1; @@ -786,10 +782,8 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {    case VO_PROP_WINDOW_HEIGHT:      return this->sc.gui_height;    default: -    if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("video_out_xshm: tried to get unsupported property %d\n",  -	      property); -    } +    xprintf(this->xine, XINE_VERBOSITY_LOG,  +	    "video_out_xshm: tried to get unsupported property %d\n", property);    }    return 0; @@ -804,10 +798,8 @@ static int xshm_set_property (vo_driver_t *this_gen,      if (value>=XINE_VO_ASPECT_NUM_RATIOS)        value = XINE_VO_ASPECT_AUTO;      this->sc.user_ratio = value; -    if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("video_out_xshm: aspect ratio changed to %s\n", -	      _x_vo_scale_aspect_ratio_name(value)); -    } +    xprintf(this->xine, XINE_VERBOSITY_LOG,  +	    "video_out_xshm: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));    } else if (property == VO_PROP_BRIGHTNESS) { @@ -1115,13 +1107,10 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi    this->visual = attribs.visual;    this->depth  = attribs.depth; -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -    if (this->depth>16) -      printf ("\n\n" -	      "WARNING: current display depth is %d. For better performance\n" -	      "a depth of 16 bpp is recommended!\n\n", -	      this->depth); -  } +  if (this->depth>16) +    xprintf(this->xine, XINE_VERBOSITY_LOG, +	    "\n\nWARNING: current display depth is %d. For better performance\n" +	    "a depth of 16 bpp is recommended!\n\n", this->depth);    /*     * check for X shared memory support @@ -1132,8 +1121,8 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi      this->use_shm = 1;    }     else { -    if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -      printf ("video_out_xshm: MIT shared memory extension not present on display.\n"); +    xprintf(this->xine, XINE_VERBOSITY_LOG, +	    "video_out_xshm: MIT shared memory extension not present on display.\n");      this->use_shm = 0;    } @@ -1153,14 +1142,13 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi    cpu_byte_order = htonl(1) == 1 ? MSBFirst : LSBFirst;    swapped = cpu_byte_order != this->image_byte_order; -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -    printf ("video_out_xshm: video mode depth is %d (%d bpp), %s, %sswapped,\n" -	    "\tred: %08lx, green: %08lx, blue: %08lx\n", -	    this->depth, this->bpp, -	    visual_class_name(this->visual), -	    swapped ? "" : "not ", -	    this->visual->red_mask, this->visual->green_mask, this->visual->blue_mask); -  } +  xprintf(this->xine, XINE_VERBOSITY_LOG, +	  "video_out_xshm: video mode depth is %d (%d bpp), %s, %sswapped,\n" +	  "\tred: %08lx, green: %08lx, blue: %08lx\n", +	  this->depth, this->bpp, +	  visual_class_name(this->visual), +	  swapped ? "" : "not ", +	  this->visual->red_mask, this->visual->green_mask, this->visual->blue_mask);    mode = 0; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index a91bf39eb..1e3be022a 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: video_out_xv.c,v 1.184 2003/11/26 19:43:37 f1rmb Exp $ + * $Id: video_out_xv.c,v 1.185 2003/11/26 23:44:10 f1rmb Exp $   *   * video_out_xv.c, X11 video extension interface for xine   * @@ -41,6 +41,7 @@  #include <stdio.h>  #include <stdlib.h>  #include <string.h> +#include <errno.h>  #include <math.h>  #if defined (__SVR4) && defined (__sun) @@ -279,10 +280,9 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,  			     width, height, shminfo);      if (image == NULL )  { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf("video_out_xv: XvShmCreateImage failed\n"); -	printf("video_out_xv: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: XvShmCreateImage failed\n" +	      "video_out_xv: => not using MIT Shared Memory extension.\n");        this->use_shm = 0;        goto finishShmTesting;      } @@ -290,19 +290,17 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,      shminfo->shmid = shmget(IPC_PRIVATE, image->data_size, IPC_CREAT | 0777);      if (image->data_size==0) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf("video_out_xv: XvShmCreateImage returned a zero size\n"); -	printf("video_out_xv: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: XvShmCreateImage returned a zero size\n" +	      "video_out_xv: => not using MIT Shared Memory extension.\n");        this->use_shm = 0;        goto finishShmTesting;      }      if (shminfo->shmid < 0 ) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	perror("video_out_xv: shared memory error in shmget: "); -	printf("video_out_xv: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: shared memory error in shmget: %s" +	      "video_out_xv: => not using MIT Shared Memory extension.\n", strerror(errno));        this->use_shm = 0;        goto finishShmTesting;      } @@ -310,15 +308,15 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,      shminfo->shmaddr  = (char *) shmat(shminfo->shmid, 0, 0);      if (shminfo->shmaddr == NULL) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("video_out_xv: shared memory error (address error NULL)\n"); +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: shared memory error (address error NULL)\n");        this->use_shm = 0;        goto finishShmTesting;      }      if (shminfo->shmaddr == ((char *) -1)) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("video_out_xv: shared memory error (address error)\n"); +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: shared memory error (address error)\n");        this->use_shm = 0;        goto finishShmTesting;      } @@ -332,10 +330,9 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,      shmctl(shminfo->shmid, IPC_RMID, 0);      if (gX11Fail) { -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf ("video_out_xv: x11 error during shared memory XImage creation\n"); -	printf ("video_out_xv: => not using MIT Shared Memory extension.\n"); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: x11 error during shared memory XImage creation\n" +	      "video_out_xv: => not using MIT Shared Memory extension.\n");        shmdt (shminfo->shmaddr);        shmctl (shminfo->shmid, IPC_RMID, 0);        shminfo->shmid = -1; @@ -798,9 +795,8 @@ static int xv_get_property (vo_driver_t *this_gen, int property) {        break;    } -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf ("video_out_xv: property #%d = %d\n", property, -	    this->props[property].value); +  xprintf(this->xine, XINE_VERBOSITY_LOG, +	  "video_out_xv: property #%d = %d\n", property, this->props[property].value);    return this->props[property].value;  } @@ -844,10 +840,8 @@ static int xv_set_property (vo_driver_t *this_gen,      case VO_PROP_INTERLACED:        this->props[property].value = value; -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf("video_out_xv: VO_PROP_INTERLACED(%d)\n", -	       this->props[property].value); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG, +	      "video_out_xv: VO_PROP_INTERLACED(%d)\n", this->props[property].value);        this->deinterlace_enabled = value;        if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) {           xv_compute_ideal_size (this); @@ -860,10 +854,8 @@ static int xv_set_property (vo_driver_t *this_gen,  	value = XINE_VO_ASPECT_AUTO;        this->props[property].value = value; -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG) { -	printf("video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n", -	       this->props[property].value); -      } +      xprintf(this->xine, XINE_VERBOSITY_LOG,  +	      "video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);        this->sc.user_ratio = value;        xv_compute_ideal_size (this); @@ -874,10 +866,9 @@ static int xv_set_property (vo_driver_t *this_gen,      case VO_PROP_ZOOM_X:        if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {          this->props[property].value = value; -	if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	  printf ("video_out_xv: VO_PROP_ZOOM_X = %d\n", -		  this->props[property].value); - +	xprintf(this->xine, XINE_VERBOSITY_LOG, +		"video_out_xv: VO_PROP_ZOOM_X = %d\n", this->props[property].value); +	  	this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;  	xv_compute_ideal_size (this); @@ -889,9 +880,8 @@ static int xv_set_property (vo_driver_t *this_gen,      case VO_PROP_ZOOM_Y:        if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {          this->props[property].value = value; -	if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	  printf ("video_out_xv: VO_PROP_ZOOM_Y = %d\n", -		  this->props[property].value); +	xprintf(this->xine, XINE_VERBOSITY_LOG, +		"video_out_xv: VO_PROP_ZOOM_Y = %d\n", this->props[property].value);  	this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP; @@ -1086,10 +1076,9 @@ static void xv_check_capability (xv_driver_t *this,    XvGetPortAttribute (this->display, this->xv_port,  		      this->props[property].atom, &int_default); -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf ("video_out_xv: port attribute %s (%d) value is %d\n", -	    str_prop, property, int_default); - +  xprintf(this->xine, XINE_VERBOSITY_LOG, +	  "video_out_xv: port attribute %s (%d) value is %d\n", str_prop, property, int_default); +      if (config_name) {      /* is this a boolean property ? */      if ((attr.min_value == 0) && (attr.max_value == 1)) { @@ -1146,8 +1135,8 @@ static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {    XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter);    XUnlockDisplay(this->display); -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf("video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter); +  xprintf(this->xine, XINE_VERBOSITY_LOG, +	  "video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);  }  static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) { @@ -1162,8 +1151,8 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)    XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer);    XUnlockDisplay(this->display); -  if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -    printf("video_out_xv: double buffering mode = %d\n",xv_double_buffer); +  xprintf(this->xine, XINE_VERBOSITY_LOG, +	  "video_out_xv: double buffering mode = %d\n", xv_double_buffer);  }  static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { @@ -1322,9 +1311,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi      }      XFree(attr);    } -  else if (this->xine->verbosity >= XINE_VERBOSITY_DEBUG)  { -    printf("video_out_xv: no port attributes defined.\n"); -  } +  else +    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xv: no port attributes defined.\n");    /*     * check supported image formats @@ -1344,13 +1332,11 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi      if (fo[i].id == XINE_IMGFMT_YV12)  {        this->xv_format_yv12 = fo[i].id;        this->capabilities |= VO_CAP_YV12; -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("video_out_xv: this adaptor supports the yv12 format.\n"); +      xprintf(this->xine, XINE_VERBOSITY_LOG,"video_out_xv: this adaptor supports the yv12 format.\n");      } else if (fo[i].id == XINE_IMGFMT_YUY2) {        this->xv_format_yuy2 = fo[i].id;        this->capabilities |= VO_CAP_YUY2; -      if (this->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("video_out_xv: this adaptor supports the yuy2 format.\n"); +      xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_xv: this adaptor supports the yuy2 format.\n");      }    } @@ -1468,18 +1454,17 @@ static void *init_class (xine_t *xine, void *visual_gen) {    }    if (!xv_port) { -    if (xine->verbosity >= XINE_VERBOSITY_LOG) { -      printf ("video_out_xv: Xv extension is present but " -	      "I couldn't find a usable yuv12 port.\n"); -      printf ("              Looks like your graphics hardware " -	      "driver doesn't support Xv?!\n"); -    } +    xprintf(xine, XINE_VERBOSITY_LOG, +	    "video_out_xv: Xv extension is present but I couldn't find a usable yuv12 port.\n" +	    "              Looks like your graphics hardware driver doesn't support Xv?!\n"); +          /* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/      XUnlockDisplay(display);      return NULL;    }  -  else if (xine->verbosity >= XINE_VERBOSITY_LOG) -    printf ("video_out_xv: using Xv port %ld from adaptor %s for hardware " +  else +    xprintf(xine, XINE_VERBOSITY_LOG, +	    "video_out_xv: using Xv port %ld from adaptor %s for hardware "              "colorspace conversion and scaling.\n", xv_port,              adaptor_info[adaptor_num].name); diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 480a6e205..2ae362c88 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: audio_decoder.c,v 1.115 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.116 2003/11/26 23:44:10 f1rmb Exp $   *   *   * functions that implement audio decoding @@ -183,9 +183,8 @@ static void *audio_decoder_loop (void *stream_gen) {      case BUF_CONTROL_AUDIO_CHANNEL:        { -	if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) -	  printf ("audio_decoder: suggested switching to stream_id %02x\n", -		  buf->decoder_info[0]); +	xprintf(stream->xine, XINE_VERBOSITY_DEBUG,  +		"audio_decoder: suggested switching to stream_id %02x\n", buf->decoder_info[0]);  	stream->audio_channel_auto = buf->decoder_info[0] & 0xff;        }        break; diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index e5b4d8ffd..41f8e24e6 100644 --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -19,7 +19,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: broadcaster.c,v 1.3 2003/11/11 18:45:00 f1rmb Exp $ + * $Id: broadcaster.c,v 1.4 2003/11/26 23:44:10 f1rmb Exp $   *    * broadcaster.c - xine network broadcaster   * @@ -164,8 +164,7 @@ static void broadcaster_data_write(broadcaster_t *this, char *buf, int len) {      /* in case of failure remove from list */      if( sock_data_write(*psock, buf, len) < 0 ) { -      if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -        printf("broadcaster: closing socket %d\n", *psock); +      xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "broadcaster: closing socket %d\n", *psock);        close(*psock);        free(psock);        if( this->connections->cur->next ) @@ -226,8 +225,8 @@ static void *manager_loop (void *this_gen) {              int *psock = malloc(sizeof(int));              *psock = ssock; -            if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -              printf("broadcaster: new connection socket %d\n", *psock); +            xprintf(this->stream->xine, XINE_VERBOSITY_LOG,  +		    "broadcaster: new connection socket %d\n", *psock);              xine_list_append_content(this->connections, psock);            }          } @@ -348,8 +347,7 @@ void _x_close_broadcaster(broadcaster_t *this)    psock = xine_list_first_content (this->connections);    while (psock) { -    if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) -      printf("broadcaster: closing socket %d\n", *psock); +    xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "broadcaster: closing socket %d\n", *psock);      close(*psock);      free(psock);      xine_list_delete_current (this->connections); diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 15e614f4d..3d1a44ba1 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: load_plugins.c,v 1.165 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: load_plugins.c,v 1.166 2003/11/26 23:44:10 f1rmb Exp $   *   *   * Load input/demux/audio_out/video_out/codec plugins @@ -305,9 +305,9 @@ static void _insert_plugin (xine_t *this,    int                i;    if (info->API != api_version) { -    if (this->verbosity >= XINE_VERBOSITY_LOG) -      printf ("load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n", -	      info->id, info->API, api_version); +    xprintf(this, XINE_VERBOSITY_LOG,  +	    "load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n", +	    info->id, info->API, api_version);      return;    } @@ -467,12 +467,9 @@ static void collect_plugins(xine_t *this, char *path){  	  if(!info && !(lib = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) { -	    if (this->verbosity >= XINE_VERBOSITY_LOG) { -	      char *dl_error_msg = dlerror(); -	      /* too noisy -- but good to catch unresolved references */ -	      printf ("load_plugins: cannot open plugin lib %s:\n%s\n", -		      str, dl_error_msg); -	    } +	    /* too noisy -- but good to catch unresolved references */ +	    xprintf(this, XINE_VERBOSITY_LOG,  +		    "load_plugins: cannot open plugin lib %s:\n%s\n", str, dlerror());  	  } else { @@ -1055,8 +1052,7 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth      while (node) {        demux_plugin_t *plugin; -      if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)  -	printf ("load_plugins: probing demux '%s'\n", node->info->id); +      xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "load_plugins: probing demux '%s'\n", node->info->id);        if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {  	pthread_mutex_unlock (&catalog->lock); @@ -1613,9 +1609,8 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ      if (!node->plugin_class) {        /* remove non working plugin from catalog */ -      if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("load_plugins: plugin %s failed to init its class.\n",  -	       node->info->id); +      xprintf(stream->xine, XINE_VERBOSITY_LOG,  +	      "load_plugins: plugin %s failed to init its class.\n", node->info->id);        for (j = i + 1; j < PLUGINS_PER_TYPE; j++)          catalog->video_decoder_map[stream_type][j - 1] =            catalog->video_decoder_map[stream_type][j]; @@ -1633,8 +1628,8 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ        return vd;      } else {        /* remove non working plugin from catalog */ -      if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)  -	printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id); +      xprintf(stream->xine, XINE_VERBOSITY_LOG, +	      "load_plugins: plugin %s failed to instantiate itself.\n", node->info->id);        for (j = i + 1; j < PLUGINS_PER_TYPE; j++)          catalog->video_decoder_map[stream_type][j - 1] =            catalog->video_decoder_map[stream_type][j]; diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 69a1939d1..1f8b5eee5 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: metronom.c,v 1.130 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: metronom.c,v 1.131 2003/11/26 23:44:10 f1rmb Exp $   */  #ifdef HAVE_CONFIG_H @@ -313,8 +313,8 @@ static void metronom_handle_discontinuity (metronom_t *this, int type,        this->force_audio_jump = 1;        this->force_video_jump = 1;        this->video_drift = 0; -      xprintf(this->xine, XINE_VERBOSITY_DEBUG, "vpts adjusted with prebuffer to %lld\n",  -        this->video_vpts); +      xprintf(this->xine, XINE_VERBOSITY_DEBUG, +	      "vpts adjusted with prebuffer to %lld\n", this->video_vpts);        break;      case DISC_ABSOLUTE: @@ -529,7 +529,7 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type,    pthread_cond_signal (&this->audio_discontinuity_reached);    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio discontinuity #%d, type is %d, disc_off %lld\n", -    this->audio_discontinuity_count, type, disc_off); +	  this->audio_discontinuity_count, type, disc_off);    if (this->have_video) { @@ -538,7 +538,7 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type,              this->discontinuity_handled_count ) {        xprintf(this->xine, XINE_VERBOSITY_DEBUG, "waiting for in_discontinuity update #%d\n",  -        this->audio_discontinuity_count); +	      this->audio_discontinuity_count);        pthread_cond_wait (&this->video_discontinuity_reached, &this->lock);      } diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 4a34a0ad2..777948048 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: scratch.c,v 1.11 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: scratch.c,v 1.12 2003/11/26 23:44:11 f1rmb Exp $   *   * top-level xine functions   * @@ -41,16 +41,12 @@  #include "xineutils.h"  static void scratch_printf (scratch_buffer_t *this, const char *format, va_list argp) { - -  vsnprintf (this->lines[this->cur], 1023, format, argp); - +  vsnprintf (this->lines[this->cur], SCRATCH_LINE_LEN_MAX, format, argp);    lprintf ("printing format %s to line %d\n", format, this->cur); -    this->cur = (this->cur + 1) % this->num_lines;  }  static const char **scratch_get_content (scratch_buffer_t *this) { -    int i, j;    for(i = 0, j = (this->cur - 1); i < this->num_lines; i++, j--) { @@ -59,9 +55,7 @@ static const char **scratch_get_content (scratch_buffer_t *this) {        j = (this->num_lines - 1);      this->ordered[i] = this->lines[j]; -      lprintf ("line %d contains >%s<\n", i , this->lines[j]); -    }    return this->ordered; @@ -69,42 +63,42 @@ static const char **scratch_get_content (scratch_buffer_t *this) {  }  static void scratch_dispose (scratch_buffer_t *this) { - -  int i; - -  for(i = 0; i < this->num_lines; i++ ) { -    free (this->lines[i]); -  } - +  char *mem; +  int   i; +   +  mem = (char *) this->lines[0]; +  free(mem); +   +  for(i = 0; i < this->num_lines; i++ ) +    this->lines[i] = NULL; +      free (this->lines);    free (this->ordered);    free (this); -  }  scratch_buffer_t *_x_new_scratch_buffer (int num_lines) { -    scratch_buffer_t *this; -  int i; +  int               i; +  char             *mem;    this = xine_xmalloc (sizeof (scratch_buffer_t));    this->lines   = xine_xmalloc (sizeof (char *) * (num_lines + 1));    this->ordered = xine_xmalloc (sizeof (char *) * (num_lines + 1)); -  for (i=0; i<num_lines; i++) { -    this->lines[i]   = (char *) xine_xmalloc (sizeof(char) * 1024); -    memset(this->lines[i], 0, sizeof(this->lines[i])); -  } -  this->ordered[i]  = NULL; -  this->lines[i]    = NULL; +  mem = (char *) xine_xmalloc((sizeof(char) * SCRATCH_LINE_LEN_MAX) * num_lines); -  this->scratch_printf = scratch_printf; -  this->get_content = scratch_get_content; -  this->dispose = scratch_dispose; +  for (i = 0; i < num_lines; i++) +    this->lines[i] = (char *) (mem + i * SCRATCH_LINE_LEN_MAX); -  this->num_lines   = num_lines; -  this->cur         = 0; +  this->ordered[i]     = NULL; +  this->lines[i]       = NULL; +  this->scratch_printf = scratch_printf; +  this->get_content    = scratch_get_content; +  this->dispose        = scratch_dispose; +  this->num_lines      = num_lines; +  this->cur            = 0;    return this;  } diff --git a/src/xine-engine/scratch.h b/src/xine-engine/scratch.h index e79fe6b4b..72d8901c8 100644 --- a/src/xine-engine/scratch.h +++ b/src/xine-engine/scratch.h @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: scratch.h,v 1.6 2003/11/11 18:45:01 f1rmb Exp $ + * $Id: scratch.h,v 1.7 2003/11/26 23:44:11 f1rmb Exp $   *   * scratch buffer for log output   * @@ -30,6 +30,8 @@  typedef struct scratch_buffer_s scratch_buffer_t; +#define SCRATCH_LINE_LEN_MAX  1024 +  struct scratch_buffer_s {    void         (*scratch_printf) (scratch_buffer_t *this, const char *format, va_list ap); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 18bfa8300..4073690cf 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: video_out.c,v 1.181 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: video_out.c,v 1.182 2003/11/26 23:44:11 f1rmb Exp $   *   * frame allocation / queuing / scheduling / output functions   */ @@ -1534,8 +1534,9 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver,        /* FIXME: how does this happen ? */        printf (_("video_out: sorry, this should not happen. please restart xine.\n"));        abort(); -    } else if (xine->verbosity >= XINE_VERBOSITY_DEBUG) -      printf ("video_out: thread created\n"); +    } +    else +      xprintf(xine, XINE_VERBOSITY_DEBUG, "video_out: thread created\n");      pthread_attr_destroy(&pth_attrs);    } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index a8e7d5587..73a968cb2 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: xine.c,v 1.272 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: xine.c,v 1.273 2003/11/26 23:44:11 f1rmb Exp $   */  /* @@ -1203,7 +1203,7 @@ xine_t *xine_new (void) {     */    for (i = 0; i < XINE_LOG_NUM; i++) -    this->log_buffers[i] = _x_new_scratch_buffer (25); +    this->log_buffers[i] = _x_new_scratch_buffer (150);  #ifdef WIN32 @@ -1611,27 +1611,25 @@ const char *const *xine_get_log_names (xine_t *this) {    log_sections[XINE_LOG_MSG]      = _("messages");    log_sections[XINE_LOG_PLUGIN]   = _("plugin"); +  log_sections[XINE_LOG_TRACE]    = _("trace");    log_sections[XINE_LOG_NUM]      = NULL;    return log_sections;  }  void xine_log (xine_t *this, int buf, const char *format, ...) { -    va_list argp; - +  char    buffer[SCRATCH_LINE_LEN_MAX]; +      va_start (argp, format); -    this->log_buffers[buf]->scratch_printf (this->log_buffers[buf], format, argp); -  va_end (argp); - -  if (this->verbosity) { -    va_start (argp, format); - -    vprintf (format, argp); - -    va_end (argp); +   +  if(this->verbosity) { +    vsnprintf(buffer, SCRATCH_LINE_LEN_MAX, format, argp); +    printf(buffer);    } +   +  va_end (argp);  }  const char *const *xine_get_log (xine_t *this, int buf) { diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 95a41398c..352cca677 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: xine_internal.h,v 1.149 2003/11/16 23:33:49 f1rmb Exp $ + * $Id: xine_internal.h,v 1.150 2003/11/26 23:44:11 f1rmb Exp $   *   */ @@ -84,7 +84,8 @@ extern "C" {  #define XINE_LOG_MSG       0 /* warnings, errors, ... */  #define XINE_LOG_PLUGIN    1 -#define XINE_LOG_NUM       2 /* # of log buffers defined */ +#define XINE_LOG_TRACE     2 +#define XINE_LOG_NUM       3 /* # of log buffers defined */  #define XINE_STREAM_INFO_MAX 99 diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 25926df17..93fc3b812 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA   * - * $Id: xineutils.h,v 1.65 2003/11/26 21:28:47 valtri Exp $ + * $Id: xineutils.h,v 1.66 2003/11/26 23:44:11 f1rmb Exp $   *   */  #ifndef XINEUTILS_H @@ -953,29 +953,29 @@ void xine_print_trace(void);  #endif /* __GNUC__ */  #ifdef  __GNUC__ -  #define xprintf(xine, verbose, fmt, args...)  \ -    do {                                        \ -      if((xine)->verbosity >= verbose){         \ -        LOG_MODULE_STRING                       \ -        printf(fmt, ##args);                    \ -      }                                         \ +  #define xprintf(xine, verbose, fmt, args...)       \ +    do {                                             \ +      if((xine)->verbosity >= verbose){              \ +        LOG_MODULE_STRING                            \ +        xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \ +      }                                              \      } while(0)  #else  #ifdef _MSC_VER -  #define xprintf(xine, verbose, fmtargs)       \ -    do {                                        \ -      if((xine)->verbosity >= verbose){         \ -        LOG_MODULE_STRING                       \ -        printf("%s", fmtargs);                  \ -      }                                         \ +  #define xprintf(xine, verbose, fmtargs)            \ +    do {                                             \ +      if((xine)->verbosity >= verbose){              \ +        LOG_MODULE_STRING                            \ +        xine_log(xine, XINE_LOG_TRACE, fmtargs);     \ +      }                                              \      } while(0)  #else  -  #define xprintf(xine, verbose, ...)           \ -    do {                                        \ -      if((xine)->verbosity >= verbose){         \ -        LOG_MODULE_STRING                       \ -        printf(__VA_ARGS__);                    \ -      }                                         \ +  #define xprintf(xine, verbose, ...)                \ +    do {                                             \ +      if((xine)->verbosity >= verbose){              \ +        LOG_MODULE_STRING                            \ +        xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \ +      }                                              \      } while(0)  #endif /* _MSC_VER */  #endif /* __GNUC__ */ | 
