summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2003-03-06 16:49:30 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2003-03-06 16:49:30 +0000
commit558eded1985948ecca254984cf539edd28e6bcb1 (patch)
tree0c889692c1583557036d49c78ab9bb03c1662c9a /src/xine-engine
parentbc4d6536121a7db75c7592b33d35d0a0531c4b75 (diff)
downloadxine-lib-558eded1985948ecca254984cf539edd28e6bcb1.tar.gz
xine-lib-558eded1985948ecca254984cf539edd28e6bcb1.tar.bz2
steps toward muting xine's console output by default
CVS patchset: 4345 CVS date: 2003/03/06 16:49:30
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/demux.c4
-rw-r--r--src/xine-engine/load_plugins.c13
-rw-r--r--src/xine-engine/metronom.c44
-rw-r--r--src/xine-engine/video_out.c4
-rw-r--r--src/xine-engine/xine.c84
5 files changed, 96 insertions, 53 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 9ef4c6a69..e2f7c671c 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -31,7 +31,9 @@
#include "demuxers/demux.h"
#include "buffer.h"
+/*
#define LOG
+*/
/* internal use only - called from demuxers on seek/stop
* warning: after clearing decoders fifos an absolute discontinuity
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index d01d919a2..ca0d91fa9 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.141 2003/02/23 21:32:48 guenter Exp $
+ * $Id: load_plugins.c,v 1.142 2003/03/06 16:49:32 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -150,7 +150,7 @@ static void _insert_plugin (xine_t *this,
int i;
if (info->API != api_version) {
- if (this->verbosity)
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
printf ("load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n",
info->id, info->API, api_version);
return;
@@ -296,7 +296,7 @@ static void collect_plugins(xine_t *this, char *path){
if(!info && !(lib = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) {
- if (this->verbosity) {
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG) {
char *dl_error_msg = dlerror();
/* too noisy -- but good to catch unresolved references */
printf ("load_plugins: cannot open plugin lib %s:\n%s\n",
@@ -1034,8 +1034,6 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth
printf ("load_plugins: probing demux '%s'\n", node->info->id);
#endif
if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
- if (stream->xine->verbosity)
- printf ("load_plugins: using demuxer '%s'\n", node->info->id);
pthread_mutex_unlock (&catalog->lock);
return plugin;
}
@@ -1627,7 +1625,7 @@ video_decoder_t *get_video_decoder (xine_stream_t *stream, uint8_t stream_type)
if (!node->plugin_class) {
/* remove non working plugin from catalog */
- if (stream->xine->verbosity)
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
printf("load_plugins: plugin %s failed to init its class.\n",
node->info->id);
for (j = i + 1; j < PLUGINS_PER_TYPE; j++)
@@ -1647,7 +1645,8 @@ video_decoder_t *get_video_decoder (xine_stream_t *stream, uint8_t stream_type)
return vd;
} else {
/* remove non working plugin from catalog */
- printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id);
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf("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 71e057f78..775fcd0f1 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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.112 2003/02/28 02:51:51 storri Exp $
+ * $Id: metronom.c,v 1.113 2003/03/06 16:49:33 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -289,15 +289,17 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,
this->video_discontinuity_count++;
pthread_cond_signal (&this->video_discontinuity_reached);
- printf ("metronom: video discontinuity #%d, type is %d, disc_off is %lld\n",
- this->video_discontinuity_count, type, disc_off);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video discontinuity #%d, type is %d, disc_off is %lld\n",
+ this->video_discontinuity_count, type, disc_off);
if (this->have_audio) {
while (this->audio_discontinuity_count <
this->video_discontinuity_count) {
- printf ("metronom: waiting for audio discontinuity #%d\n",
- this->video_discontinuity_count);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: waiting for audio discontinuity #%d\n",
+ this->video_discontinuity_count);
pthread_cond_wait (&this->audio_discontinuity_reached, &this->lock);
}
@@ -306,12 +308,16 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,
if ( this->video_vpts < this->clock->get_current_time(this->clock) ||
type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) {
this->video_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock);
- printf ("metronom: video vpts adjusted with prebuffer to %lld\n", this->video_vpts);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video vpts adjusted with prebuffer to %lld\n",
+ this->video_vpts);
}
if ( this->audio_vpts < this->clock->get_current_time(this->clock) ||
type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) {
this->audio_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock);
- printf ("metronom: audio vpts adjusted with prebuffer to %lld\n", this->audio_vpts);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: audio vpts adjusted with prebuffer to %lld\n",
+ this->audio_vpts);
}
#ifdef LOG
@@ -421,7 +427,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
this->video_vpts = vpts;
this->video_drift = 0;
- printf ("metronom: video jump\n");
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video jump\n");
} else {
@@ -471,15 +478,17 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type,
this->audio_discontinuity_count++;
pthread_cond_signal (&this->audio_discontinuity_reached);
- printf ("metronom: audio discontinuity #%d, type is %d, disc_off %lld\n",
- this->audio_discontinuity_count, type, disc_off);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: audio discontinuity #%d, type is %d, disc_off %lld\n",
+ this->audio_discontinuity_count, type, disc_off);
/* next_vpts_offset, in_discontinuity is handled in expect_video_discontinuity */
while ( this->audio_discontinuity_count >
this->discontinuity_handled_count ) {
- printf ("metronom: waiting for in_discontinuity update #%d\n",
- this->audio_discontinuity_count);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: waiting for in_discontinuity update #%d\n",
+ this->audio_discontinuity_count);
pthread_cond_wait (&this->video_discontinuity_reached, &this->lock);
}
@@ -511,7 +520,8 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts,
this->force_audio_jump = 0;
this->audio_vpts = vpts;
this->audio_drift_step = 0;
- printf("metronom: audio jump, diff=%lld\n", diff);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf("metronom: audio jump, diff=%lld\n", diff);
}
else {
if( this->audio_samples ) {
@@ -566,11 +576,13 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) {
switch (option) {
case METRONOM_AV_OFFSET:
this->av_offset = value;
- printf ("metronom: av_offset=%lld pts\n", this->av_offset);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("metronom: av_offset=%lld pts\n", this->av_offset);
break;
case METRONOM_SPU_OFFSET:
this->spu_offset = value;
- printf ("metronom: spu_offset=%lld pts\n", this->spu_offset);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("metronom: spu_offset=%lld pts\n", this->spu_offset);
break;
case METRONOM_ADJ_VPTS_OFFSET:
this->audio_vpts += value;
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 7f4001ed8..9e0fd35b5 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.147 2003/02/28 02:51:51 storri Exp $
+ * $Id: video_out.c,v 1.148 2003/03/06 16:49:33 guenter Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -1447,7 +1447,7 @@ xine_video_port_t *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
+ } else if (xine->verbosity >= XINE_VERBOSITY_DEBUG)
printf ("video_out: thread created\n");
}
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index c4e675fa7..e5c9a6442 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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.232 2003/03/05 23:55:06 siggi Exp $
+ * $Id: xine.c,v 1.233 2003/03/06 16:49:33 guenter Exp $
*
* top-level xine functions
*
@@ -348,7 +348,8 @@ xine_stream_t *xine_stream_new (xine_t *this,
xine_stream_t *stream;
int i;
- printf ("xine: xine_stream_new\n");
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_stream_new\n");
/*
* create a new stream object
@@ -524,11 +525,6 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
= strdup (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class));
free(input_source);
-#ifdef LOG
- printf ("xine: input plugin %s found\n",
- stream->input_plugin->input_class->get_identifier(stream->input_plugin->input_class));
-#endif
-
while (stream_setup && *stream_setup && *(++stream_setup)) {
if (strncasecmp(stream_setup, "demux", 5) == 0) {
if (*(stream_setup += 5) == ':') {
@@ -554,9 +550,6 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
free(demux_name);
return 0;
}
-#ifdef LOG
- printf ("xine: demux and input plugin found\n");
-#endif
stream->meta_info[XINE_META_INFO_SYSTEMLAYER]
= strdup (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class));
@@ -618,7 +611,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring video\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring video\n");
continue;
}
if (strncasecmp(stream_setup, "noaudio", 7) == 0) {
@@ -631,7 +625,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring audio\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring audio\n");
continue;
}
if (strncasecmp(stream_setup, "nospu", 5) == 0) {
@@ -644,7 +639,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring subpicture\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring subpicture\n");
continue;
}
if (strncasecmp(stream_setup, "volume", 6) == 0) {
@@ -715,7 +711,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->slave = xine_stream_new (stream->xine, NULL, stream->video_out );
stream->slave_affection = XINE_MASTER_SLAVE_PLAY | XINE_MASTER_SLAVE_STOP;
if( xine_open( stream->slave, subtitle_mrl ) ) {
- printf("xine: subtitle mrl opened\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: subtitle mrl opened\n");
stream->slave->master = stream;
stream->slave_is_subtitle = 1;
} else {
@@ -800,8 +797,10 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
= strdup (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class));
}
- printf("xine: found input plugin : %s\n",stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
- printf("xine: found demuxer plugin: %s\n",stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("xine: found input plugin : %s\n",stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
+ printf("xine: found demuxer plugin: %s\n",stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ }
extra_info_reset( stream->current_extra_info );
extra_info_reset( stream->video_decoder_extra_info );
@@ -826,7 +825,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->demux_plugin->dispose (stream->demux_plugin);
stream->demux_plugin = NULL;
- printf ("xine: demux disposed\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: demux disposed\n");
stream->input_plugin->dispose (stream->input_plugin);
stream->input_plugin = NULL;
@@ -840,7 +840,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
- printf ("xine: return from xine_open_internal\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: return from xine_open_internal\n");
return 0;
}
@@ -877,7 +878,8 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t
off_t pos, len;
int demux_status;
- printf ("xine: xine_play\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_play\n");
if (stream->xine->clock->speed != XINE_SPEED_NORMAL)
xine_set_speed_internal (stream, XINE_SPEED_NORMAL);
@@ -947,7 +949,8 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t
extra_info_reset( stream->current_extra_info );
pthread_mutex_unlock( &stream->current_extra_info_lock );
- printf ("xine: xine_play_internal ...done\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_play_internal ...done\n");
return 1;
}
@@ -991,7 +994,8 @@ int xine_eject (xine_stream_t *stream) {
void xine_dispose (xine_stream_t *stream) {
- printf ("xine: xine_dispose\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_dispose\n");
stream->status = XINE_STATUS_QUIT;
@@ -1004,11 +1008,13 @@ void xine_dispose (xine_stream_t *stream) {
stream->slave->master = NULL;
}
- printf ("xine_exit: shutdown audio\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: shutdown audio\n");
audio_decoder_shutdown (stream);
- printf ("xine_exit: shutdown video\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: shutdown video\n");
video_decoder_shutdown (stream);
@@ -1034,7 +1040,8 @@ void xine_exit (xine_t *this) {
int i;
- printf ("xine_exit: bye!\n");
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: bye!\n");
for (i = 0; i < XINE_LOG_NUM; i++)
this->log_buffers[i]->dispose (this->log_buffers[i]);
@@ -1090,6 +1097,16 @@ xine_t *xine_new (void) {
pthread_mutex_init (&this->streams_lock, NULL);
+ /*
+ * verbose setting
+ */
+
+ this->verbosity = this->config->register_num (this->config,
+ "misc.verbosity",
+ XINE_VERBOSITY_NONE,
+ "default verbosity setting",
+ NULL, 40, NULL, NULL);
+
return this;
}
@@ -1098,6 +1115,19 @@ void xine_init (xine_t *this) {
static char *demux_strategies[] = {"default", "reverse", "content",
"extension", NULL};
+ /*
+ * frontends don't have a chance to set xine parameters at this point
+ * so read verbosity setting from config values
+ */
+ {
+ cfg_entry_t *verbose_entry;
+ verbose_entry = this->config->lookup_entry (this->config, "misc.verbosity");
+ if (verbose_entry) {
+ this->verbosity = verbose_entry->num_value;
+ }
+ }
+
+
/* initialize color conversion tables and functions */
init_yuv_conversion();
@@ -1226,7 +1256,8 @@ void xine_set_speed (xine_stream_t *stream, int speed) {
else if (speed > XINE_SPEED_FAST_4)
speed = XINE_SPEED_FAST_4;
- printf ("xine: set_speed %d\n", speed);
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: set_speed %d\n", speed);
xine_set_speed_internal (stream, speed);
pthread_mutex_unlock (&stream->frontend_lock);
@@ -1481,4 +1512,3 @@ int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
slave->master = master->master;
return 1;
}
-