diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-12-05 15:54:56 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2003-12-05 15:54:56 +0000 |
commit | 7958ce62d6ae127ee9b8664c8afae5754063389f (patch) | |
tree | 658e11edf004b0ae3ac3114ffe8ed5f8604ccefd /src/xine-engine | |
parent | b529e4b1f1668c03d3cb35c0c742f301b8c415db (diff) | |
download | xine-lib-7958ce62d6ae127ee9b8664c8afae5754063389f.tar.gz xine-lib-7958ce62d6ae127ee9b8664c8afae5754063389f.tar.bz2 |
cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
CVS patchset: 5844
CVS date: 2003/12/05 15:54:56
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 14 | ||||
-rw-r--r-- | src/xine-engine/audio_out.c | 35 | ||||
-rw-r--r-- | src/xine-engine/broadcaster.c | 30 | ||||
-rw-r--r-- | src/xine-engine/configfile.c | 14 | ||||
-rw-r--r-- | src/xine-engine/demux.c | 5 | ||||
-rw-r--r-- | src/xine-engine/events.c | 8 | ||||
-rw-r--r-- | src/xine-engine/input_rip.c | 54 | ||||
-rw-r--r-- | src/xine-engine/io_helper.c | 8 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 68 | ||||
-rw-r--r-- | src/xine-engine/lrb.c | 6 | ||||
-rw-r--r-- | src/xine-engine/metronom.c | 6 | ||||
-rw-r--r-- | src/xine-engine/osd.c | 54 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 8 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 25 | ||||
-rw-r--r-- | src/xine-engine/video_overlay.c | 25 | ||||
-rw-r--r-- | src/xine-engine/video_overlay.h | 4 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 87 | ||||
-rw-r--r-- | src/xine-engine/xine_interface.c | 13 |
18 files changed, 226 insertions, 238 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 2ae362c88..df870004d 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.116 2003/11/26 23:44:10 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.117 2003/12/05 15:55:04 f1rmb Exp $ * * * functions that implement audio decoding @@ -304,9 +304,8 @@ static void *audio_decoder_loop (void *stream_gen) { if (buf->type != buftype_unknown && !_x_stream_info_get(stream, XINE_STREAM_INFO_AUDIO_HANDLED)) { - xine_log (stream->xine, XINE_LOG_MSG, - "audio_decoder: no plugin available to handle '%s'\n", - _x_buf_audio_name( buf->type ) ); + xine_log (stream->xine, XINE_LOG_MSG, + _("audio_decoder: no plugin available to handle '%s'\n"), _x_buf_audio_name( buf->type ) ); if( !_x_meta_info_get(stream, XINE_META_INFO_AUDIOCODEC) ) _x_meta_info_set(stream, XINE_META_INFO_AUDIOCODEC, _x_buf_audio_name( buf->type )); @@ -323,8 +322,7 @@ static void *audio_decoder_loop (void *stream_gen) { } } else if( buf->type != buftype_unknown ) { xine_log (stream->xine, XINE_LOG_MSG, - "audio_decoder: error, unknown buffer type: %08x\n", - buf->type ); + _("audio_decoder: error, unknown buffer type: %08x\n"), buf->type ); buftype_unknown = buf->type; } @@ -373,8 +371,8 @@ void _x_audio_decoder_init (xine_stream_t *stream) { if ((err = pthread_create (&stream->audio_thread, &pth_attrs, audio_decoder_loop, stream)) != 0) { - fprintf (stderr, "audio_decoder: can't create new thread (%s)\n", - strerror(err)); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + "audio_decoder: can't create new thread (%s)\n", strerror(err)); abort(); } diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index fdd3eea69..6bd3ea0eb 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.154 2003/12/03 10:24:41 andruil Exp $ + * $Id: audio_out.c,v 1.155 2003/12/05 15:55:04 f1rmb Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -276,16 +276,14 @@ struct audio_fifo_s { }; -static audio_fifo_t *fifo_new (void) { +static audio_fifo_t *fifo_new (xine_t *xine) { audio_fifo_t *fifo; fifo = (audio_fifo_t *) xine_xmalloc (sizeof (audio_fifo_t)); - if (!fifo) { - printf ("audio_out: out of memory!\n"); + if (!fifo) return NULL; - } fifo->first = NULL; fifo->last = NULL; @@ -427,9 +425,8 @@ static void ao_fill_gap (aos_t *this, int64_t pts_len) { num_frames = pts_len * this->frames_per_kpts / 1024; - xprintf (this->xine, XINE_VERBOSITY_LOG, - "inserting %d 0-frames to fill a gap of %" PRId64 " pts\n", - num_frames, pts_len); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "inserting %d 0-frames to fill a gap of %" PRId64 " pts\n", num_frames, pts_len); if ((this->output.mode == AO_CAP_MODE_A52) || (this->output.mode == AO_CAP_MODE_AC5)) { write_pause_burst(this,num_frames); @@ -1131,7 +1128,7 @@ int xine_get_next_audio_frame (xine_audio_port_t *this_gen, if (!in_buf) { pthread_mutex_unlock(&this->out_fifo->mutex); - printf ("audio_audio: EOS\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_audio: EOS\n"); return 0; } @@ -1187,7 +1184,7 @@ static int ao_change_settings(aos_t *this, uint32_t bits, uint32_t rate, int mod !(this->driver->get_capabilities(this->driver) & AO_CAP_8BITS) ) { bits = 16; xprintf (this->xine, XINE_VERBOSITY_LOG, - "8 bits not supported by driver, converting to 16 bits.\n"); + _("8 bits not supported by driver, converting to 16 bits.\n")); } /* provide mono->stereo and stereo->mono conversions */ @@ -1195,13 +1192,13 @@ static int ao_change_settings(aos_t *this, uint32_t bits, uint32_t rate, int mod !(this->driver->get_capabilities(this->driver) & AO_CAP_MODE_MONO) ) { mode = AO_CAP_MODE_STEREO; xprintf (this->xine, XINE_VERBOSITY_LOG, - "mono not supported by driver, converting to stereo.\n"); + _("mono not supported by driver, converting to stereo.\n")); } if( this->input.mode == AO_CAP_MODE_STEREO && !(this->driver->get_capabilities(this->driver) & AO_CAP_MODE_STEREO) ) { mode = AO_CAP_MODE_MONO; xprintf (this->xine, XINE_VERBOSITY_LOG, - "stereo not supported by driver, converting to mono.\n"); + _("stereo not supported by driver, converting to mono.\n")); } output_sample_rate=this->driver->open(this->driver,bits,(this->force_rate ? this->force_rate : rate),mode); @@ -1211,11 +1208,11 @@ static int ao_change_settings(aos_t *this, uint32_t bits, uint32_t rate, int mod if ( output_sample_rate == 0) { this->driver_open = 0; - xprintf (this->xine, XINE_VERBOSITY_LOG, "open failed!\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "open failed!\n"); return 0; }; - xprintf (this->xine, XINE_VERBOSITY_LOG, "output sample rate %d\n", output_sample_rate); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "output sample rate %d\n", output_sample_rate); this->last_audio_vpts = 0; this->output.mode = mode; @@ -1835,8 +1832,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, * pre-allocate memory for samples */ - this->free_fifo = fifo_new (); - this->out_fifo = fifo_new (); + this->free_fifo = fifo_new (this->xine); + this->out_fifo = fifo_new (this->xine); for (i=0; i<NUM_AUDIO_BUFFERS; i++) { @@ -1901,8 +1898,10 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, if ((err = pthread_create (&this->audio_thread, &pth_attrs, ao_loop, this)) != 0) { - printf ("audio_out: can't create thread (%s)\n", strerror(err)); - printf ("audio_out: sorry, this should not happen. please restart xine.\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "audio_out: can't create thread (%s)\n", strerror(err)); + xprintf (this->xine, XINE_VERBOSITY_LOG, + _("audio_out: sorry, this should not happen. please restart xine.\n")); abort(); } else diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index 41f8e24e6..4e0b4142e 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.4 2003/11/26 23:44:10 f1rmb Exp $ + * $Id: broadcaster.c,v 1.5 2003/12/05 15:55:04 f1rmb Exp $ * * broadcaster.c - xine network broadcaster * @@ -110,7 +110,7 @@ static int sock_check_opened(int socket) { /* * Write to socket. */ -static int sock_data_write(int socket, char *buf, int len) { +static int sock_data_write(xine_t *xine, int socket, char *buf, int len) { ssize_t size; int wlen = 0; @@ -124,7 +124,7 @@ static int sock_data_write(int socket, char *buf, int len) { size = write(socket, buf, len); if(size <= 0) { - printf("broadcaster: error writing to socket %d\n",socket); + xprintf(xine, XINE_VERBOSITY_DEBUG, "broadcaster: error writing to socket %d\n",socket); return -1; } @@ -136,7 +136,7 @@ static int sock_data_write(int socket, char *buf, int len) { return wlen; } -static int sock_string_write(int socket, char *msg, ...) { +static int sock_string_write(xine_t *xine, int socket, char *msg, ...) { char buf[_BUFSIZ]; va_list args; @@ -148,7 +148,7 @@ static int sock_string_write(int socket, char *msg, ...) { if((buf[strlen(buf)] == '\0') && (buf[strlen(buf) - 1] != '\n')) sprintf(buf, "%s%c", buf, '\n'); - return sock_data_write(socket, buf, strlen(buf)); + return sock_data_write(xine, socket, buf, strlen(buf)); } /* @@ -162,9 +162,9 @@ static void broadcaster_data_write(broadcaster_t *this, char *buf, int len) { while (psock) { /* in case of failure remove from list */ - if( sock_data_write(*psock, buf, len) < 0 ) { + if( sock_data_write(this->stream->xine, *psock, buf, len) < 0 ) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "broadcaster: closing socket %d\n", *psock); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: closing socket %d\n", *psock); close(*psock); free(psock); if( this->connections->cur->next ) @@ -221,11 +221,11 @@ static void *manager_loop (void *this_gen) { ssock = accept(this->msock, (struct sockaddr *)&fsin, &alen); if (ssock >= 0) { /* identification string, helps demuxer probing */ - if( sock_string_write(ssock,"master xine v1") > 0 ) { + if( sock_string_write(this->stream->xine, ssock,"master xine v1") > 0 ) { int *psock = malloc(sizeof(int)); *psock = ssock; - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: new connection socket %d\n", *psock); xine_list_append_content(this->connections, psock); } @@ -300,7 +300,7 @@ broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) msock = socket(PF_INET, SOCK_STREAM, 0); if( msock < 0 ) { - printf("broadcaster: error opening master socket.\n"); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: error opening master socket.\n"); return NULL; } servAddr.sin_family = AF_INET; @@ -309,7 +309,7 @@ broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) if(bind(msock, (struct sockaddr *) &servAddr, sizeof(servAddr))<0) { - printf("broadcaster: error binding to port %d\n", port); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: error binding to port %d\n", port); return NULL; } @@ -333,9 +333,9 @@ broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) this->running = 1; if ((err = pthread_create (&this->manager_thread, NULL, manager_loop, (void *)this)) != 0) { - printf ("broadcaster: can't create new thread (%s)\n", - strerror(err)); - abort(); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + "broadcaster: can't create new thread (%s)\n", strerror(err)); + abort(); } return this; @@ -347,7 +347,7 @@ void _x_close_broadcaster(broadcaster_t *this) psock = xine_list_first_content (this->connections); while (psock) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "broadcaster: closing socket %d\n", *psock); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "broadcaster: closing socket %d\n", *psock); close(*psock); free(psock); xine_list_delete_current (this->connections); diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 823e9cab9..80cd57641 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.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: configfile.c,v 1.57 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: configfile.c,v 1.58 2003/12/05 15:55:04 f1rmb Exp $ * * config object (was: file) management - implementation * @@ -673,7 +673,7 @@ void xine_config_load (xine_t *xine, const char *filename) { sscanf(line + 9, "%d", &this->current_version); if (this->current_version > CONFIG_FILE_VERSION) xine_log(xine, XINE_LOG_MSG, - _("The current config file has been modified by a newer version of xine.")); + _("The current config file has been modified by a newer version of xine.")); } continue; } @@ -763,8 +763,8 @@ void xine_config_save (xine_t *xine, const char *filename) { } if (!backup && (stat(filename, &config_stat) == 0)) { - printf("configfile: WARNING: backing up configfile to %s failed\n", temp); - printf("configfile: WARNING: your configuration will not be saved\n"); + xprintf(xine, XINE_VERBOSITY_LOG, _("configfile: WARNING: backing up configfile to %s failed\n"), temp); + xprintf(xine, XINE_VERBOSITY_LOG, _("configfile: WARNING: your configuration will not be saved\n")); return; } @@ -859,9 +859,9 @@ void xine_config_save (xine_t *xine, const char *filename) { pthread_mutex_unlock(&this->config_lock); if (fclose(f_config) != 0) { - printf("configfile: WARNING: writing configuration to %s failed\n", filename); - printf("configfile: WARNING: removing possibly broken config file %s\n", filename); - printf("configfile: WARNING: you should check the backup file %s\n", temp); + xprintf(xine, XINE_VERBOSITY_LOG, _("configfile: WARNING: writing configuration to %s failed\n"), filename); + xprintf(xine, XINE_VERBOSITY_LOG, _("configfile: WARNING: removing possibly broken config file %s\n"), filename); + xprintf(xine, XINE_VERBOSITY_LOG, _("configfile: WARNING: you should check the backup file %s\n"), temp); /* writing config failed -> remove file, it might be broken ... */ unlink(filename); /* ... but keep the backup */ diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index e49a93fba..2ce91fe4d 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -20,7 +20,7 @@ * Demuxer helper functions * hide some xine engine details from demuxers and reduce code duplication * - * $Id: demux.c,v 1.42 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: demux.c,v 1.43 2003/12/05 15:55:04 f1rmb Exp $ */ @@ -294,8 +294,7 @@ int _x_demux_start_thread (xine_stream_t *stream) { stream->demux_thread_running = 1; if ((err = pthread_create (&stream->demux_thread, NULL, demux_loop, (void *)stream)) != 0) { - printf ("demux: can't create new thread (%s)\n", - strerror(err)); + printf ("demux: can't create new thread (%s)\n", strerror(err)); abort(); } } diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c index 2f8ed16b8..998a2d159 100644 --- a/src/xine-engine/events.c +++ b/src/xine-engine/events.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: events.c,v 1.20 2003/11/16 15:41:15 mroi Exp $ + * $Id: events.c,v 1.21 2003/12/05 15:55:04 f1rmb Exp $ * * Event handling functions * @@ -138,7 +138,7 @@ void xine_event_dispose_queue (xine_event_queue_t *queue) { q = (xine_event_queue_t *) xine_list_next_content (stream->event_queues); if (!q) { - printf ("events: tried to dispose queue which is not in list\n"); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "events: tried to dispose queue which is not in list\n"); pthread_mutex_unlock (&stream->event_queues_lock); return; @@ -218,8 +218,8 @@ void xine_event_create_listener_thread (xine_event_queue_t *queue, if ((err = pthread_create (queue->listener_thread, NULL, listener_loop, queue)) != 0) { - fprintf (stderr, "events: can't create new thread (%s)\n", - strerror(err)); + xprintf (queue->stream->xine, XINE_VERBOSITY_DEBUG, + "events: can't create new thread (%s)\n", strerror(err)); abort(); } } diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index b5525d384..09fadd783 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -29,7 +29,7 @@ * - it's possible speeder saving streams in the xine without playing: * xine stream_mrl#save:file.raw\;noaudio\;novideo * - * $Id: input_rip.c,v 1.18 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: input_rip.c,v 1.19 2003/12/05 15:55:04 f1rmb Exp $ */ /* TODO: @@ -127,7 +127,7 @@ static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { lprintf(" => read %lld bytes from file\n", nread_file); if (fread(&buf[npreview], nread_file, 1, this->file) != 1) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: reading of saved data failed: %s\n"), strerror(errno)); + _("input_rip: reading of saved data failed: %s\n"), strerror(errno)); return -1; } } @@ -142,7 +142,7 @@ static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { if (retlen < 0) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: reading by input plugin failed\n")); + _("input_rip: reading by input plugin failed\n")); return -1; } @@ -151,7 +151,7 @@ static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) { nwrite = retlen - nread_orig; if (fwrite(buf + this->savepos - this->curpos, nwrite, 1, this->file) != 1) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: error writing to file %lld bytes: %s\n"), + _("input_rip: error writing to file %lld bytes: %s\n"), retlen - nread_orig, strerror(errno)); return -1; } @@ -173,7 +173,7 @@ static int rip_plugin_open(input_plugin_t *this_gen) { rip_input_plugin_t *this = (rip_input_plugin_t *)this_gen; xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: open() function should never be called\n")); + _("input_rip: open() function should never be called\n")); return 0; } @@ -249,7 +249,7 @@ static buf_element_t *rip_plugin_read_block(input_plugin_t *this_gen, fifo_buffe lprintf(" => read %lld bytes from the file (block)\n", nread_file); if (fread(&buf->content[npreview], nread_file, 1, this->file) != 1) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: reading of saved data failed: %s\n"), strerror(errno)); + _("input_rip: reading of saved data failed: %s\n"), strerror(errno)); return NULL; } } @@ -280,7 +280,7 @@ static buf_element_t *rip_plugin_read_block(input_plugin_t *this_gen, fifo_buffe nwrite = retlen - nread_orig; if (fwrite(buf->content + this->savepos - this->curpos, nwrite, 1, this->file) != 1) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: error writing to file %lld bytes: %s\n"), + _("input_rip: error writing to file %lld bytes: %s\n"), retlen - nread_orig, strerror(errno)); return NULL; } @@ -303,8 +303,7 @@ static off_t rip_seek_original(rip_input_plugin_t *this, off_t reqpos) { pos = this->main_input_plugin->seek(this->main_input_plugin, reqpos, SEEK_SET); if (pos == -1) { - xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: seeking failed\n")); + xine_log(this->stream->xine, XINE_LOG_MSG, _("input_rip: seeking failed\n")); return -1; } #ifdef LOG @@ -361,8 +360,7 @@ static off_t rip_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin) if (reqpos != this->savepos) { lprintf(" => seeking file to %lld\n", reqpos); if (fseeko(this->file, reqpos, SEEK_SET) != 0) { - xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: seeking failed: %s\n"), strerror(errno)); + xine_log(this->stream->xine, XINE_LOG_MSG, _("input_rip: seeking failed: %s\n"), strerror(errno)); return -1; } } @@ -380,17 +378,15 @@ static off_t rip_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin) if (this->regular) { lprintf(" => seeking file to end: %lld\n", this->savepos); if (fseeko(this->file, this->savepos, SEEK_SET) != 0) { - xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: seeking failed: %s\n"), strerror(errno)); + xine_log(this->stream->xine, XINE_LOG_MSG, _("input_rip: seeking failed: %s\n"), strerror(errno)); return -1; } this->curpos = this->savepos; } else { if ((pos = rip_seek_original(this, this->savepos)) == -1) return -1; if (pos > this->savepos) - xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: %lld bytes dropped\n"), - pos - this->savepos); + xine_log(this->stream->xine, XINE_LOG_MSG, _("input_rip: %lld bytes dropped\n"), + pos - this->savepos); } } @@ -411,8 +407,7 @@ static off_t rip_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin) toread = sizeof(buffer); if( rip_plugin_read(this_gen, buffer, toread) <= 0 ) { - xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: seeking failed\n")); + xine_log(this->stream->xine, XINE_LOG_MSG, _("input_rip: seeking failed\n")); break; } } @@ -540,32 +535,30 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f /* check given input plugin */ if (!stream->input_plugin) { - xine_log(stream->xine, XINE_LOG_MSG, - _("input_rip: input plugin not defined!\n")); + xine_log(stream->xine, XINE_LOG_MSG, _("input_rip: input plugin not defined!\n")); return NULL; } if (!stream->xine->save_path[0]) { xine_log(stream->xine, XINE_LOG_MSG, - _("input_rip: target directory wasn't specified, please fill out the option 'misc.save_dir'\n")); + _("input_rip: target directory wasn't specified, please fill out the option 'misc.save_dir'\n")); _x_message(stream, XINE_MSG_SECURITY, - _("The stream save feature is disabled until you set misc.save_dir in the configuration.")); + _("The stream save feature is disabled until you set misc.save_dir in the configuration.")); return NULL; } #ifndef SAVING_ALWAYS_PERMIT if ( main_plugin->get_capabilities(main_plugin) & INPUT_CAP_RIP_FORBIDDEN ) { xine_log(stream->xine, XINE_LOG_MSG, - _("input_rip: ripping/caching of this source is not permitted!\n")); + _("input_rip: ripping/caching of this source is not permitted!\n")); _x_message(stream, XINE_MSG_SECURITY, - _("xine is not allowed to save from this source. (possibly copyrighted material?)")); + _("xine is not allowed to save from this source. (possibly copyrighted material?)")); return NULL; } #endif if (!filename || !filename[0]) { - xine_log(stream->xine, XINE_LOG_MSG, - _("input_rip: file name not given!\n")); + xine_log(stream->xine, XINE_LOG_MSG, _("input_rip: file name not given!\n")); return NULL; } @@ -584,8 +577,7 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f /* find out type of target */ if (stat(target, &pstat) < 0 && errno != ENOENT) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: stat on the file %s failed: %s\n"), - target, strerror(errno)); + _("input_rip: stat on the file %s failed: %s\n"), target, strerror(errno)); free(this); return NULL; } @@ -605,8 +597,7 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f if ((this->file = fopen(target, mode)) == NULL) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: error opening file %s: %s\n"), - target, strerror(errno)); + _("input_rip: error opening file %s: %s\n"), target, strerror(errno)); free(this); return NULL; } @@ -636,8 +627,7 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f if (this->preview && this->preview_size) { if (fwrite(this->preview, this->preview_size, 1, this->file) != 1) { xine_log(this->stream->xine, XINE_LOG_MSG, - _("input_rip: error writing to file %lld bytes: %s\n"), - this->preview_size, strerror(errno)); + _("input_rip: error writing to file %lld bytes: %s\n"), this->preview_size, strerror(errno)); fclose(this->file); free(this); return NULL; diff --git a/src/xine-engine/io_helper.c b/src/xine-engine/io_helper.c index 9798c0378..f631a0736 100644 --- a/src/xine-engine/io_helper.c +++ b/src/xine-engine/io_helper.c @@ -98,7 +98,7 @@ static int _x_io_tcp_connect_ipv4(xine_stream_t *stream, const char *host, int p if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) { #else if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError() != WSAEWOULDBLOCK) { - printf("io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); #endif /* WIN32 */ _x_message(stream, XINE_MSG_CONNECTION_REFUSED, strerror(errno), NULL); @@ -128,7 +128,7 @@ int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) { snprintf(strport, sizeof(strport), "%d", port); - printf("Resolving host '%s' at port '%s'\n", host, strport); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "Resolving host '%s' at port '%s'\n", host, strport); error = getaddrinfo(host, strport, &hints, &res); @@ -167,7 +167,7 @@ int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) { tmpaddr->ai_addrlen)==-1 && WSAGetLastError() != WSAEWOULDBLOCK) { - printf("io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); #endif /* WIN32 */ error = errno; @@ -286,7 +286,7 @@ static off_t xio_rw_abort(xine_stream_t *stream, int fd, int cmd, char *buf, off #else if (WSAGetLastError() == WSAEWOULDBLOCK) continue; - printf("io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "io_helper: WSAGetLastError() = %d\n", WSAGetLastError()); #endif return ret; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 14751e1b1..1fbae6d69 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.167 2003/11/27 13:20:22 f1rmb Exp $ + * $Id: load_plugins.c,v 1.168 2003/12/05 15:55:04 f1rmb Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -306,7 +306,7 @@ static void _insert_plugin (xine_t *this, if (info->API != api_version) { xprintf(this, XINE_VERBOSITY_LOG, - "load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n", + _("load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"), info->id, info->API, api_version); return; } @@ -345,8 +345,8 @@ static void _insert_plugin (xine_t *this, decoder_old = info->special_info; decoder_new = xine_xmalloc(sizeof(decoder_info_t)); if (decoder_old == NULL) { - printf ("load_plugins: plugin %s from %s is broken: special_info=NULL\n", - info->id, entry->filename); + xprintf (this, XINE_VERBOSITY_DEBUG, + "load_plugins: plugin %s from %s is broken: special_info = NULL\n", info->id, entry->filename); abort(); } for (i=0; decoder_old->supported_types[i] != 0; ++i); @@ -431,8 +431,7 @@ static void collect_plugins(xine_t *this, char *path){ sprintf (str, "%s/%s", path, pEntry->d_name); if (stat(str, &statbuffer)) { - xine_log (this, XINE_LOG_PLUGIN, - _("load_plugins: unable to stat %s\n"), str); + xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: unable to stat %s\n"), str); } else { switch (statbuffer.st_mode & S_IFMT){ @@ -469,7 +468,7 @@ static void collect_plugins(xine_t *this, char *path){ /* 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()); + _("load_plugins: cannot open plugin lib %s:\n%s\n"), str, dlerror()); } else { @@ -479,7 +478,7 @@ static void collect_plugins(xine_t *this, char *path){ xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: plugin %s found\n"), str); - + switch (info->type & PLUGIN_TYPE_MASK){ case PLUGIN_INPUT: _insert_plugin (this, this->plugin_catalog->input, str, @@ -602,8 +601,7 @@ static void *_load_plugin_class(xine_t *this, } else { xine_log (this, XINE_LOG_PLUGIN, - "load_plugins: Yikes! %s doesn't contain plugin info.\n", - filename); + _("load_plugins: Yikes! %s doesn't contain plugin info.\n"), filename); } } @@ -1026,15 +1024,14 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth int i; int methods[3]; - xine_t *xine = stream->xine; - plugin_catalog_t *catalog = xine->plugin_catalog; + plugin_catalog_t *catalog = stream->xine->plugin_catalog; methods[0] = method1; methods[1] = method2; methods[2] = -1; if (methods[0] == -1) { - printf ("load_plugins: probe_demux method1 = %d is not allowed \n", method1); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "load_plugins: probe_demux method1 = %d is not allowed \n", method1); abort(); } @@ -1087,8 +1084,8 @@ demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *inp return probe_demux (stream, METHOD_BY_EXTENSION, -1, input); default: - printf ("load_plugins: unknown content detection strategy %d\n", - stream->xine->demux_strategy); + xprintf (stream->xine, XINE_VERBOSITY_LOG, + _("load_plugins: unknown content detection strategy %d\n"), stream->xine->demux_strategy); abort(); } @@ -1159,9 +1156,14 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha if (strcasecmp(node->info->id, last_demux_name) == 0) { last_demux = node; } else { - printf("load_plugin: probing '%s' (method %d)...\n", node->info->id, stream->content_detection_method ); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugin: probing '%s' (method %d)...\n", node->info->id, stream->content_detection_method ); + if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { - printf ("load_plugins: using demuxer '%s' (instead of '%s')\n", node->info->id, last_demux_name); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugins: using demuxer '%s' (instead of '%s')\n", node->info->id, last_demux_name); + + pthread_mutex_unlock (&catalog->lock); return plugin; } @@ -1181,7 +1183,7 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha stream->content_detection_method = METHOD_BY_CONTENT; if ((plugin = ((demux_class_t *)last_demux->plugin_class)->open_plugin(last_demux->plugin_class, stream, input))) { - printf ("load_plugins: using demuxer '%s'\n", last_demux_name); + xprintf (stream->xine, XINE_VERBOSITY_LOG, _("load_plugins: using demuxer '%s'\n"), last_demux_name); return plugin; } @@ -1493,9 +1495,11 @@ xine_audio_port_t *xine_open_audio_driver (xine_t *this, const char *id, if (!driver) { if (id) - printf ("load_plugins: failed to load audio output plugin <%s>\n", id); + xprintf (this, XINE_VERBOSITY_LOG, + _("load_plugins: failed to load audio output plugin <%s>\n"), id); else - printf ("load_plugins: audio output auto-probing didn't find any usable audio driver.\n"); + xprintf (this, XINE_VERBOSITY_LOG, + _("load_plugins: audio output auto-probing didn't find any usable audio driver.\n")); return NULL; } @@ -1609,7 +1613,7 @@ 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 */ - xprintf(stream->xine, XINE_VERBOSITY_LOG, + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "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] = @@ -1628,7 +1632,7 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ return vd; } else { /* remove non working plugin from catalog */ - xprintf(stream->xine, XINE_VERBOSITY_LOG, + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "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] = @@ -1684,7 +1688,8 @@ audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_typ if (!node->plugin_class) { /* remove non working plugin from catalog */ - printf("load_plugins: plugin %s failed to init its class.\n", node->info->id); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugins: plugin %s failed to init its class.\n", node->info->id); for (j = i + 1; j < PLUGINS_PER_TYPE; j++) catalog->audio_decoder_map[stream_type][j - 1] = catalog->audio_decoder_map[stream_type][j]; @@ -1702,7 +1707,8 @@ audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_typ return ad; } else { /* remove non working plugin from catalog */ - printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugins: plugin %s failed to instantiate itself.\n", node->info->id); for (j = i + 1; j < PLUGINS_PER_TYPE; j++) catalog->audio_decoder_map[stream_type][j - 1] = catalog->audio_decoder_map[stream_type][j]; @@ -1756,7 +1762,8 @@ spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) { if (!node->plugin_class) { /* remove non working plugin from catalog */ - printf("load_plugins: plugin %s failed to init its class.\n", node->info->id); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugins: plugin %s failed to init its class.\n", node->info->id); for (j = i + 1; j < PLUGINS_PER_TYPE; j++) catalog->spu_decoder_map[stream_type][j - 1] = catalog->spu_decoder_map[stream_type][j]; @@ -1774,7 +1781,8 @@ spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) { return sd; } else { /* remove non working plugin from catalog */ - printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id); + xprintf(stream->xine, XINE_VERBOSITY_DEBUG, + "load_plugins: plugin %s failed to instantiate itself.\n", node->info->id); for (j = i + 1; j < PLUGINS_PER_TYPE; j++) catalog->spu_decoder_map[stream_type][j - 1] = catalog->spu_decoder_map[stream_type][j]; @@ -1902,7 +1910,8 @@ xine_post_t *xine_post_init(xine_t *xine, const char *name, int inputs, node->plugin_class = _load_plugin_class(xine, node->filename, node->info, NULL); if (!node->plugin_class) { - printf("load_plugins: requested post plugin %s failed to load\n", name); + xprintf(xine, XINE_VERBOSITY_DEBUG, + "load_plugins: requested post plugin %s failed to load\n", name); pthread_mutex_unlock(&catalog->lock); return NULL; } @@ -1955,7 +1964,8 @@ xine_post_t *xine_post_init(xine_t *xine, const char *name, int inputs, return &post->xine_post; } else { - printf("load_plugins: post plugin %s failed to instantiate itself\n", name); + xprintf(xine, XINE_VERBOSITY_DEBUG, + "load_plugins: post plugin %s failed to instantiate itself\n", name); pthread_mutex_unlock(&catalog->lock); return NULL; } @@ -1966,7 +1976,7 @@ xine_post_t *xine_post_init(xine_t *xine, const char *name, int inputs, pthread_mutex_unlock(&catalog->lock); - printf("load_plugins: no post plugin named %s found\n", name); + xprintf(xine, XINE_VERBOSITY_DEBUG, "load_plugins: no post plugin named %s found\n", name); return NULL; } diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c index 63072472b..c13a4dee1 100644 --- a/src/xine-engine/lrb.c +++ b/src/xine-engine/lrb.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: lrb.c,v 1.4 2003/02/28 02:51:51 storri Exp $ + * $Id: lrb.c,v 1.5 2003/12/05 15:55:04 f1rmb Exp $ * */ @@ -79,7 +79,7 @@ void lrb_add (lrb_t *this, buf_element_t *buf) { this->cur_num_entries++; } - printf ("lrb: %d elements in buffer\n", this->cur_num_entries); + lprintf ("lrb: %d elements in buffer\n", this->cur_num_entries); } @@ -106,7 +106,7 @@ void lrb_feedback (lrb_t *this, fifo_buffer_t *fifo) { this->cur_num_entries--; - printf ("lrb: feedback\n"); + lprintf ("lrb: feedback\n"); } diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 1f8b5eee5..5d2996fe6 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.131 2003/11/26 23:44:10 f1rmb Exp $ + * $Id: metronom.c,v 1.132 2003/12/05 15:55:04 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -174,7 +174,7 @@ static void unixscr_exit (scr_plugin_t *scr) { static scr_plugin_t* unixscr_init () { unixscr_t *this; - this = malloc(sizeof(*this)); + this = (unixscr_t *) xine_xmalloc(sizeof(unixscr_t)); memset(this, 0, sizeof(*this)); this->scr.interface_version = 2; @@ -907,7 +907,7 @@ metronom_t * _x_metronom_init (int have_video, int have_audio, xine_t *xine) { metronom_clock_t *_x_metronom_clock_init(xine_t *xine) { - metronom_clock_t *this = (metronom_clock_t *)malloc(sizeof(metronom_clock_t)); + metronom_clock_t *this = (metronom_clock_t *) xine_xmalloc(sizeof(metronom_clock_t)); int err; this->set_option = metronom_clock_set_option; diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 478f5f772..d4fd58d94 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -596,8 +596,8 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) { known_font->loaded = 1; known_font->fontchar = font->fontchar; } else { - printf("font '%s-%d' already loaded, weird.\n", - font->name, font->size); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("font '%s-%d' already loaded, weird.\n"), font->name, font->size); while( --i >= 0 ) { free(font->fontchar[i].bmp); } @@ -607,9 +607,9 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) { } } else { - - printf("font '%s' loading failed (%d < %d)\n",font->name, - i, font->num_fontchars); + + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("font '%s' loading failed (%d < %d)\n") ,font->name, i, font->num_fontchars); while( --i >= 0 ) { free(font->fontchar[i].bmp); @@ -618,8 +618,8 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) { free(font); } } else { - printf("wrong version for font '%s'. expected %d found %d.\n",font->name, - font->version, FONT_VERSION); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("wrong version for font '%s'. expected %d found %d.\n"), font->name, font->version, FONT_VERSION); free(font); } gzclose(fp); @@ -732,7 +732,8 @@ static int osd_set_font( osd_object_t *osd, const char *fontname, int size) { if (!osd->ft2) { osd->ft2 = xine_xmalloc(sizeof(osd_ft2context_t)); if(FT_Init_FreeType( &osd->ft2->library )) { - printf("osd: cannot initialize ft2 library\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("osd: cannot initialize ft2 library\n")); free(osd->ft2); osd->ft2 = NULL; } @@ -747,13 +748,15 @@ static int osd_set_font( osd_object_t *osd, const char *fontname, int size) { sprintf(pathname, "%s/%s", XINE_FONTDIR, fontname); if (FT_New_Face(osd->ft2->library, pathname, 0, &osd->ft2->face)) { error_flag = 1; - printf("osd: error loading font %s with ft2\n", fontname); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("osd: error loading font %s with ft2\n"), fontname); } } } if (!error_flag) { if (FT_Set_Pixel_Sizes(osd->ft2->face, 0, size)) { - printf("osd: error setting font size (no scalable font?)\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("osd: error setting font size (no scalable font?)\n")); } else { ret = 1; osd->ft2->useme = 1; @@ -814,7 +817,8 @@ static int osd_search(osd_fontchar_t *array, size_t n, uint16_t code) { /* * get next unicode value */ -static uint16_t osd_iconv_getunicode(iconv_t *cd, const char *encoding, char **inbuf, size_t *inbytesleft) { +static uint16_t osd_iconv_getunicode(xine_t *xine, + iconv_t *cd, const char *encoding, char **inbuf, size_t *inbytesleft) { uint16_t unicode; char *outbuf = (char*)&unicode; size_t outbytesleft = 2; @@ -825,8 +829,9 @@ static uint16_t osd_iconv_getunicode(iconv_t *cd, const char *encoding, char **i count = iconv(cd, inbuf, inbytesleft, &outbuf, &outbytesleft); if (count == (size_t)-1 && errno != E2BIG) { /* unknown character or character wider than 16 bits, try skip one byte */ - printf(_("osd: unknown sequence starting with byte 0x%02X" - " in encoding \"%s\", skipping\n"), (*inbuf)[0] & 0xFF, encoding); + xprintf(xine, XINE_VERBOSITY_LOG, + _("osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", skipping\n"), + (*inbuf)[0] & 0xFF, encoding); if (*inbytesleft) { (*inbytesleft)--; (*inbuf)++; @@ -876,7 +881,8 @@ static int osd_set_encoding (osd_object_t *osd, const char *encoding) { if (!encoding[0]) { #ifdef HAVE_LANGINFO_CODESET if ((encoding = nl_langinfo(CODESET)) == NULL) { - printf(_("osd: can't find out current locale character set\n")); + xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG, + _("osd: can't find out current locale character set\n")); return 0; } #else @@ -886,8 +892,8 @@ static int osd_set_encoding (osd_object_t *osd, const char *encoding) { /* prepare conversion to UCS-2 */ if ((osd->cd = iconv_open("UCS-2", encoding)) == (iconv_t)-1) { - printf(_("osd: unsupported conversion %s -> UCS-2, " - "no conversion performed\n"), encoding); + xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG, + _("osd: unsupported conversion %s -> UCS-2, no conversion performed\n"), encoding); return 0; } @@ -935,7 +941,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, #endif if (proceed == 0) { - printf(_("osd: font isn't defined\n")); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: font isn't defined\n")); pthread_mutex_unlock(&this->osd_mutex); return 0; } @@ -949,7 +955,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, while( inbytesleft ) { #ifndef _MSC_VER - unicode = osd_iconv_getunicode(osd->cd, osd->encoding, + unicode = osd_iconv_getunicode(this->stream->xine, osd->cd, osd->encoding, (char **)&inbuf, &inbytesleft); #else unicode = inbuf[0]; @@ -979,13 +985,13 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, FT_GlyphSlot slot = osd->ft2->face->glyph; if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT)) { - printf("osd: error loading glyph\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error loading glyph\n")); continue; } if (slot->format != ft_glyph_format_bitmap) { if (FT_Render_Glyph(osd->ft2->face->glyph, ft_render_mode_normal)) - printf("osd: error in rendering glyph\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error in rendering glyph\n")); } dst = osd->area + y1 * osd->width + x1; @@ -1078,7 +1084,7 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in #endif if (proceed == 0) { - printf(_("osd: font isn't defined\n")); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: font isn't defined\n")); pthread_mutex_unlock(&this->osd_mutex); return 0; } @@ -1092,7 +1098,7 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in while( inbytesleft ) { #ifndef _MSC_VER - unicode = osd_iconv_getunicode(osd->cd, osd->encoding, + unicode = osd_iconv_getunicode(this->stream->xine, osd->cd, osd->encoding, (char **)&inbuf, &inbytesleft); #else unicode = inbuf[0]; @@ -1108,14 +1114,14 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in i = FT_Get_Char_Index( osd->ft2->face, unicode); if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT)) { - printf("osd: error loading glyph %i\n", i); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error loading glyph %i\n"), i); text++; continue; } if (slot->format != ft_glyph_format_bitmap) { if (FT_Render_Glyph(osd->ft2->face->glyph, ft_render_mode_normal)) - printf("osd: error in rendering\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error in rendering\n")); } if (first) *width += slot->bitmap_left; first = 0; diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index f4226a7d5..49c115869 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_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: video_decoder.c,v 1.141 2003/11/26 19:43:38 f1rmb Exp $ + * $Id: video_decoder.c,v 1.142 2003/12/05 15:55:05 f1rmb Exp $ * */ @@ -302,8 +302,7 @@ static void *video_decoder_loop (void *stream_gen) { if (buf->type != buftype_unknown && !_x_stream_info_get(stream, XINE_STREAM_INFO_VIDEO_HANDLED)) { xine_log (stream->xine, XINE_LOG_MSG, - "video_decoder: no plugin available to handle '%s'\n", - _x_buf_video_name( buf->type ) ); + _("video_decoder: no plugin available to handle '%s'\n"), _x_buf_video_name( buf->type ) ); if( !_x_meta_info_get(stream, XINE_META_INFO_VIDEOCODEC)) _x_meta_info_set(stream, XINE_META_INFO_VIDEOCODEC, _x_buf_video_name( buf->type )); @@ -368,8 +367,7 @@ static void *video_decoder_loop (void *stream_gen) { } else if (buf->type != buftype_unknown) { xine_log (stream->xine, XINE_LOG_MSG, - "video_decoder: error, unknown buffer type: %08x\n", - buf->type ); + _("video_decoder: error, unknown buffer type: %08x\n"), buf->type ); buftype_unknown = buf->type; } diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 4073690cf..7c835288e 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.182 2003/11/26 23:44:11 f1rmb Exp $ + * $Id: video_out.c,v 1.183 2003/12/05 15:55:05 f1rmb Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -614,8 +614,7 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) { if( !this->discard_frames ) { xine_log(this->xine, XINE_LOG_MSG, - _("video_out: throwing away image with pts %lld because " - "it's too old (diff : %lld).\n"), pts, diff); + _("video_out: throwing away image with pts %lld because it's too old (diff : %lld).\n"), pts, diff); this->num_frames_discarded++; } @@ -997,8 +996,8 @@ static void *video_out_loop (void *this_gen) { lprintf ("%lld usec to sleep at master vpts %lld\n", usec_to_sleep, vpts); if ( (next_frame_vpts - vpts) > 2*90000 ) - printf("video_out: vpts/clock error, next_vpts=%lld cur_vpts=%lld\n", - next_frame_vpts,vpts); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "video_out: vpts/clock error, next_vpts=%lld cur_vpts=%lld\n", next_frame_vpts,vpts); if (usec_to_sleep>0) xine_usec_sleep (usec_to_sleep); @@ -1070,9 +1069,9 @@ int xine_get_next_video_frame (xine_video_port_t *this_gen, pthread_mutex_lock(&this->display_img_buf_queue->mutex); img = this->display_img_buf_queue->first; - printf ("video_out: get_next_video_frame demux status = %d, fifo_size=%d\n", - stream->demux_plugin->get_status (stream->demux_plugin), - stream->video_fifo->fifo_size); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "video_out: get_next_video_frame demux status = %d, fifo_size=%d\n", + stream->demux_plugin->get_status (stream->demux_plugin), stream->video_fifo->fifo_size); } @@ -1457,7 +1456,7 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, this->last_frame = NULL; this->img_backup = NULL; - this->overlay_source = _x_video_overlay_new_manager(); + this->overlay_source = _x_video_overlay_new_manager(xine); this->overlay_source->init (this->overlay_source); this->overlay_enabled = 1; @@ -1529,14 +1528,14 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, if ((err = pthread_create (&this->video_thread, &pth_attrs, video_out_loop, this)) != 0) { - printf (_("video_out: can't create thread (%s)\n"), - strerror(err)); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out: can't create thread (%s)\n", strerror(err)); /* FIXME: how does this happen ? */ - printf (_("video_out: sorry, this should not happen. please restart xine.\n")); + xprintf (this->xine, XINE_VERBOSITY_LOG, + _("video_out: sorry, this should not happen. please restart xine.\n")); abort(); } else - xprintf(xine, XINE_VERBOSITY_DEBUG, "video_out: thread created\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out: thread created\n"); pthread_attr_destroy(&pth_attrs); } diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c index f8b05589c..9a1e2f7e7 100644 --- a/src/xine-engine/video_overlay.c +++ b/src/xine-engine/video_overlay.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_overlay.c,v 1.32 2003/11/11 18:45:01 f1rmb Exp $ + * $Id: video_overlay.c,v 1.33 2003/12/05 15:55:05 f1rmb Exp $ * */ @@ -59,6 +59,7 @@ typedef struct video_overlay_s { pthread_mutex_t showing_mutex; video_overlay_showing_t showing[MAX_SHOWING]; int showing_changed; + xine_t *xine; } video_overlay_t; @@ -80,7 +81,7 @@ static void add_showing_handle( video_overlay_t *this, int32_t handle ) if( i != MAX_SHOWING ) this->showing[i].handle = handle; else - printf("video_overlay: error: no showing slots available\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: error: no showing slots available\n"); } pthread_mutex_unlock( &this->showing_mutex ); @@ -275,7 +276,7 @@ static int32_t video_overlay_add_event(video_overlay_manager_t *this_gen, void /* memcpy everything except the actual image */ if ( this->events[new_event].event == NULL ) { - printf("video_overlay: error: event slot is NULL!\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: error: event slot is NULL!\n"); } this->events[new_event].event->event_type=event->event_type; this->events[new_event].event->vpts=event->vpts; @@ -283,7 +284,7 @@ static int32_t video_overlay_add_event(video_overlay_manager_t *this_gen, void this->events[new_event].event->object.pts=event->object.pts; if ( this->events[new_event].event->object.overlay ) { - printf("video_overlay: add_event: event->object.overlay was not freed!\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: add_event: event->object.overlay was not freed!\n"); } if( event->object.overlay ) { @@ -298,7 +299,7 @@ static int32_t video_overlay_add_event(video_overlay_manager_t *this_gen, void this->events[new_event].event->object.overlay = NULL; } } else { - printf("video_overlay:No spare subtitle event slots\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_overlay:No spare subtitle event slots\n"); new_event = -1; } @@ -370,7 +371,7 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) { this->objects[handle].handle = handle; if( this->objects[handle].overlay ) { - printf("video_overlay: error: object->overlay was not freed!\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: error: object->overlay was not freed!\n"); } this->objects[handle].overlay = this->events[this_event].event->object.overlay; @@ -423,7 +424,8 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) { * that this is not necessary and causes problems with some DVDs */ if ( (this->events[this_event].event->object.pts != this->objects[handle].pts) ) { - printf ("video_overlay:MENU BUTTON DROPPED menu pts=%lld spu pts=%lld\n", + xprintf (this->xine, XINE_VERBOSITY_DEBUG, + "video_overlay:MENU BUTTON DROPPED menu pts=%lld spu pts=%lld\n", this->events[this_event].event->object.pts, this->objects[handle].pts); break; @@ -456,11 +458,11 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) { #endif add_showing_handle( this, handle ); } else { - printf ("video_overlay:overlay not present\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_overlay:overlay not present\n"); } if( this->events[this_event].event->object.overlay->rle ) { - printf ("video_overlay: warning EVENT_MENU_BUTTON with rle data\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: warning EVENT_MENU_BUTTON with rle data\n"); free( this->events[this_event].event->object.overlay->rle ); this->events[this_event].event->object.overlay->rle = NULL; } @@ -472,7 +474,7 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) { break; default: - printf ("video_overlay: unhandled event type\n"); + xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_overlay: unhandled event type\n"); break; } @@ -575,12 +577,13 @@ static void video_overlay_dispose(video_overlay_manager_t *this_gen) { } -video_overlay_manager_t *_x_video_overlay_new_manager (void) { +video_overlay_manager_t *_x_video_overlay_new_manager (xine_t *xine) { video_overlay_t *this; this = (video_overlay_t *) xine_xmalloc (sizeof (video_overlay_t)); + this->xine = xine; this->video_overlay.init = video_overlay_init; this->video_overlay.dispose = video_overlay_dispose; this->video_overlay.get_handle = video_overlay_get_handle; diff --git a/src/xine-engine/video_overlay.h b/src/xine-engine/video_overlay.h index fbe133c75..d6e868357 100644 --- a/src/xine-engine/video_overlay.h +++ b/src/xine-engine/video_overlay.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: video_overlay.h,v 1.16 2003/11/11 18:45:01 f1rmb Exp $ + * $Id: video_overlay.h,v 1.17 2003/12/05 15:55:05 f1rmb Exp $ * */ @@ -101,6 +101,6 @@ typedef struct video_overlay_event_s { video_overlay_object_t object; /* The image data. */ } video_overlay_event_t; -video_overlay_manager_t *_x_video_overlay_new_manager(void); +video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *); #endif diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 73a968cb2..68e1f4c43 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.273 2003/11/26 23:44:11 f1rmb Exp $ + * $Id: xine.c,v 1.274 2003/12/05 15:55:05 f1rmb Exp $ */ /* @@ -539,8 +539,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { */ if ((stream->input_plugin = _x_find_input_plugin (stream, input_source))) { - xine_log (stream->xine, XINE_LOG_MSG, - "xine: found input plugin : %s\n", + xine_log (stream->xine, XINE_LOG_MSG, _("xine: found input plugin : %s\n"), stream->input_plugin->input_class->get_description(stream->input_plugin->input_class)); if (stream->input_plugin->input_class->eject_media) stream->eject_class = stream->input_plugin->input_class; @@ -548,8 +547,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class))); if (!stream->input_plugin->open(stream->input_plugin)) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine: input plugin cannot open MRL [%s]\n"),mrl); + xine_log (stream->xine, XINE_LOG_MSG, _("xine: input plugin cannot open MRL [%s]\n"),mrl); stream->input_plugin->dispose(stream->input_plugin); stream->input_plugin = NULL; stream->err = XINE_ERROR_INPUT_FAILED; @@ -567,8 +565,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { } if (!stream->input_plugin) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine: cannot find input plugin for MRL [%s]\n"),mrl); + xine_log (stream->xine, XINE_LOG_MSG, _("xine: cannot find input plugin for MRL [%s]\n"),mrl); stream->err = XINE_ERROR_NO_INPUT_PLUGIN; return 0; } @@ -593,8 +590,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { } __mrl_unescape(demux_name); if (!(stream->demux_plugin = _x_find_demux_plugin_by_name(stream, demux_name, stream->input_plugin))) { - xine_log(stream->xine, XINE_LOG_MSG, - _("xine: specified demuxer %s failed to start\n"), demux_name); + xine_log(stream->xine, XINE_LOG_MSG, _("xine: specified demuxer %s failed to start\n"), demux_name); stream->err = XINE_ERROR_NO_DEMUX_PLUGIN; stream->status = XINE_STATUS_STOP; free(demux_name); @@ -605,7 +601,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class))); free(demux_name); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -630,20 +626,19 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { filename[strlen(tmp)] = '\0'; } - xine_log(stream->xine, XINE_LOG_MSG, - _("xine: join rip input plugin\n")); + xine_log(stream->xine, XINE_LOG_MSG, _("xine: join rip input plugin\n")); input_saver = _x_rip_plugin_get_instance (stream, filename); if( input_saver ) { stream->input_plugin = input_saver; } else { - printf("xine: error opening rip input plugin instance\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error opening rip input plugin instance\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; } } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -667,8 +662,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { } __mrl_unescape(demux_name); if (!(stream->demux_plugin = _x_find_demux_plugin_last_probe(stream, demux_name, stream->input_plugin))) { - xine_log(stream->xine, XINE_LOG_MSG, - _("xine: last_probed demuxer %s failed to start\n"), demux_name); + xine_log(stream->xine, XINE_LOG_MSG, _("xine: last_probed demuxer %s failed to start\n"), demux_name); stream->err = XINE_ERROR_NO_DEMUX_PLUGIN; stream->status = XINE_STATUS_STOP; free(demux_name); @@ -680,7 +674,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class))); free(demux_name); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -692,12 +686,12 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { if (*stream_setup == ';' || *stream_setup == '\0') { _x_stream_info_set(stream, XINE_STREAM_INFO_IGNORE_VIDEO, 1); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; } - xprintf (stream->xine, XINE_VERBOSITY_LOG, "ignoring video\n"); + xprintf (stream->xine, XINE_VERBOSITY_LOG, _("ignoring video\n")); continue; } if (strncasecmp(stream_setup, "noaudio", 7) == 0) { @@ -705,12 +699,12 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { if (*stream_setup == ';' || *stream_setup == '\0') { _x_stream_info_set(stream, XINE_STREAM_INFO_IGNORE_AUDIO, 1); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; } - xprintf (stream->xine, XINE_VERBOSITY_LOG, "ignoring audio\n"); + xprintf (stream->xine, XINE_VERBOSITY_LOG, _("ignoring audio\n")); continue; } if (strncasecmp(stream_setup, "nospu", 5) == 0) { @@ -718,12 +712,12 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { if (*stream_setup == ';' || *stream_setup == '\0') { _x_stream_info_set(stream, XINE_STREAM_INFO_IGNORE_SPU, 1); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; } - xprintf (stream->xine, XINE_VERBOSITY_LOG, "ignoring subpicture\n"); + xprintf (stream->xine, XINE_VERBOSITY_LOG, _("ignoring subpicture\n")); continue; } if (strncasecmp(stream_setup, "volume", 6) == 0) { @@ -744,7 +738,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, atoi(volume)); free(volume); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -769,7 +763,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { xine_set_param(stream, XINE_PARAM_AUDIO_COMPR_LEVEL, atoi(compression)); free(compression); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -794,17 +788,17 @@ static int __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 ) ) { - xprintf (stream->xine, XINE_VERBOSITY_LOG, "subtitle mrl opened '%s'\n", subtitle_mrl); + xprintf (stream->xine, XINE_VERBOSITY_LOG, _("subtitle mrl opened '%s'\n"), subtitle_mrl); stream->slave->master = stream; stream->slave_is_subtitle = 1; } else { - printf("xine: error opening subtitle mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error opening subtitle mrl\n")); xine_dispose( stream->slave ); stream->slave = NULL; } free(subtitle_mrl); } else { - printf("xine: error while parsing mrl\n"); + xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n")); stream->err = XINE_ERROR_MALFORMED_MRL; stream->status = XINE_STATUS_STOP; return 0; @@ -830,12 +824,10 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { if (retval <= 0) { if (retval == 0) { /* the option not found */ - xine_log(stream->xine, XINE_LOG_MSG, - _("xine: error while parsing MRL\n")); + xine_log(stream->xine, XINE_LOG_MSG, _("xine: error while parsing MRL\n")); } else { /* not permitted to change from MRL */ - xine_log(stream->xine, XINE_LOG_MSG, - _("xine: changing option '%s' from MRL isn't permitted\n"), + xine_log(stream->xine, XINE_LOG_MSG, _("xine: changing option '%s' from MRL isn't permitted\n"), config_entry); } stream->err = XINE_ERROR_MALFORMED_MRL; @@ -855,8 +847,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { * find a demux plugin */ if (!(stream->demux_plugin = _x_find_demux_plugin (stream, stream->input_plugin))) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine: couldn't find demux for >%s<\n"), mrl); + xine_log (stream->xine, XINE_LOG_MSG, _("xine: couldn't find demux for >%s<\n"), mrl); stream->err = XINE_ERROR_NO_DEMUX_PLUGIN; stream->status = XINE_STATUS_STOP; @@ -872,8 +863,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class))); } - xine_log (stream->xine, XINE_LOG_MSG, - "xine: found demuxer plugin: %s\n", + xine_log (stream->xine, XINE_LOG_MSG, _("xine: found demuxer plugin: %s\n"), stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class)); _x_extra_info_reset( stream->current_extra_info ); @@ -893,8 +883,7 @@ static int __open_internal (xine_stream_t *stream, const char *mrl) { stream->demux_plugin->send_headers (stream->demux_plugin); if (stream->demux_plugin->get_status(stream->demux_plugin) != DEMUX_OK) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine: demuxer failed to start\n")); + xine_log (stream->xine, XINE_LOG_MSG, _("xine: demuxer failed to start\n")); stream->demux_plugin->dispose (stream->demux_plugin); stream->demux_plugin = NULL; @@ -949,8 +938,7 @@ static int __play_internal (xine_stream_t *stream, int start_pos, int start_time xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine_play\n"); if (!stream->demux_plugin) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine_play: no demux available\n")); + xine_log (stream->xine, XINE_LOG_MSG, _("xine_play: no demux available\n")); stream->err = XINE_ERROR_NO_DEMUX_PLUGIN; return 0; @@ -1020,8 +1008,7 @@ static int __play_internal (xine_stream_t *stream, int start_pos, int start_time pthread_mutex_unlock( &stream->demux_lock ); if (demux_status != DEMUX_OK) { - xine_log (stream->xine, XINE_LOG_MSG, - _("xine_play: demux failed to start\n")); + xine_log (stream->xine, XINE_LOG_MSG, _("xine_play: demux failed to start\n")); stream->err = XINE_ERROR_DEMUX_FAILED; stream->first_frame_flag = 0; @@ -1179,10 +1166,8 @@ xine_t *xine_new (void) { #endif /* WIN32 */ this = xine_xmalloc (sizeof (xine_t)); - if (!this) { - printf ("xine: failed to malloc xine_t\n"); + if (!this) abort(); - } #ifdef ENABLE_NLS /* @@ -1278,7 +1263,7 @@ static void __config_save_cb (void *this_gen, xine_cfg_entry_t *entry) { xine_stream_t *stream; xine_log(this, XINE_LOG_MSG, - _("xine: The specified save_dir \"%s\" might be a security risk.\n"), entry->str_value); + _("xine: The specified save_dir \"%s\" might be a security risk.\n"), entry->str_value); pthread_mutex_lock(&this->streams_lock); if ((stream = (xine_stream_t *)xine_list_first_content(this->streams))) @@ -1298,7 +1283,7 @@ void xine_init (xine_t *this) { init_yuv_conversion(); /* probe for optimized memcpy or config setting */ - xine_probe_fast_memcpy (this->config); + xine_probe_fast_memcpy (this); /* * plugins @@ -1308,7 +1293,7 @@ void xine_init (xine_t *this) { #ifdef HAVE_SETLOCALE if (!setlocale(LC_CTYPE, "")) - printf("xine: locale not supported by C library\n"); + xprintf(this, XINE_VERBOSITY_LOG, _("xine: locale not supported by C library\n")); #endif /* @@ -1519,8 +1504,8 @@ int xine_get_current_frame (xine_stream_t *stream, int *width, int *height, break; default: - printf ("xine: error, snapshot function not implemented for format 0x%x\n", - frame->format); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + "xine: error, snapshot function not implemented for format 0x%x\n", frame->format); abort (); } } @@ -1534,7 +1519,7 @@ int xine_get_video_frame (xine_stream_t *stream, int *duration, /* msec */ int *format, uint8_t *img) { - printf ("xine: xine_get_video_frame not implemented yet.\n"); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine: xine_get_video_frame not implemented yet.\n"); abort (); return 0; } diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index d392d668f..0003eaea8 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.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_interface.c,v 1.70 2003/11/26 14:10:57 miguelfreitas Exp $ + * $Id: xine_interface.c,v 1.71 2003/12/05 15:55:05 f1rmb Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -277,8 +277,8 @@ void xine_config_update_entry (xine_t *this, const xine_cfg_entry_t *entry) { break; default: - printf ("xine_interface: error, unknown config entry type %d\n", - entry->type); + xprintf (this, XINE_VERBOSITY_DEBUG, + "xine_interface: error, unknown config entry type %d\n", entry->type); abort(); } } @@ -439,7 +439,7 @@ void xine_set_param (xine_stream_t *stream, int param, int value) { break; default: - printf ("xine_interface: unknown param %d\n", param); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine_interface: unknown param %d\n", param); } } @@ -536,7 +536,7 @@ int xine_get_param (xine_stream_t *stream, int param) { break; default: - printf ("xine_interface: unknown param %d\n", param); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine_interface: unknown param %d\n", param); } return 0; @@ -587,7 +587,8 @@ uint32_t xine_get_stream_info (xine_stream_t *stream, int info) { return stream->spu_track_map_entries; default: - fprintf (stderr, "xine_interface: error, unknown stream info (%d) requested\n", info); + xprintf (stream->xine, XINE_VERBOSITY_DEBUG, + "xine_interface: error, unknown stream info (%d) requested\n", info); } return 0; } |