diff options
30 files changed, 297 insertions, 429 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 4fef54fb8..a61102349 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.22 2002/02/09 07:13:22 guenter Exp $ + * $Id: demux_asf.c,v 1.23 2002/02/17 17:32:49 guenter Exp $ * * demultiplexer for asf streams * @@ -58,26 +58,6 @@ #define VALID_ENDS "asf,wmv" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - typedef struct { int num; int seq; @@ -235,7 +215,7 @@ static uint8_t get_byte (demux_asf_t *this) { /* printf ("%02x ", buf); */ if (i != 1) { - LOG_MSG(this->xine, _("demux_asf: end of data\n")); + printf ("demux_asf: end of data\n"); this->status = DEMUX_FINISHED; } @@ -252,7 +232,7 @@ static uint16_t get_le16 (demux_asf_t *this) { /* printf (" [%02x %02x] ", buf[0], buf[1]); */ if (i != 2) { - LOG_MSG(this->xine, _("demux_asf: end of data\n")); + printf ("demux_asf: end of data\n"); this->status = DEMUX_FINISHED; } @@ -269,7 +249,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) { - LOG_MSG(this->xine, _("demux_asf: end of data\n")); + printf ("demux_asf: end of data\n"); this->status = DEMUX_FINISHED; } @@ -284,7 +264,7 @@ static uint64_t get_le64 (demux_asf_t *this) { i = this->input->read (this->input, buf, 8); if (i != 8) { - LOG_MSG(this->xine, _("demux_asf: end of data\n")); + printf ("demux_asf: end of data\n"); this->status = DEMUX_FINISHED; } @@ -337,13 +317,13 @@ static void asf_send_audio_header (demux_asf_t *this, int stream_id) { formattag_to_buf_audio ( wavex->wFormatTag ); if ( !this->streams[this->num_streams].buf_type ) { - LOG_MSG(this->xine, _("demux_asf: unknown audio type 0x%x\n"), wavex->wFormatTag); + printf ("demux_asf: unknown audio type 0x%x\n", wavex->wFormatTag); this->streams[this->num_streams].buf_type = BUF_CONTROL_NOP; - } - else - LOG_MSG(this->xine, _("demux_asf: audio format : %s (wFormatTag 0x%x)\n"), - buf_audio_name(this->streams[this->num_streams].buf_type), - wavex->wFormatTag); + } else + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: audio format : %s (wFormatTag 0x%x)\n"), + buf_audio_name(this->streams[this->num_streams].buf_type), + wavex->wFormatTag); this->streams[this->num_streams].buf_type |= this->num_audio_streams; this->streams[this->num_streams].fifo = this->audio_fifo; @@ -361,7 +341,7 @@ static void asf_send_audio_header (demux_asf_t *this, int stream_id) { buf->content = buf->mem; memcpy (buf->content, this->wavex, this->wavex_size); - LOG_MSG(this->xine, _("demux_asf: wavex header is %d bytes long\n"), this->wavex_size); + printf ("demux_asf: wavex header is %d bytes long\n", this->wavex_size); buf->size = this->wavex_size; buf->type = this->streams[this->num_streams].buf_type; @@ -388,7 +368,7 @@ static void asf_send_video_header (demux_asf_t *this, int stream_id) { fourcc_to_buf_video((void*)&bih->biCompression); if( !this->streams[this->num_streams].buf_type ) { - LOG_MSG(this->xine, _("demux_asf: unknown video format %.4s\n"), + printf ("demux_asf: unknown video format %.4s\n", (char*)&bih->biCompression); this->status = DEMUX_FINISHED; @@ -404,8 +384,9 @@ static void asf_send_video_header (demux_asf_t *this, int stream_id) { /* printf ("demux_asf: video format : %.4s\n", (char*)&bih->biCompression); */ - LOG_MSG(this->xine, _("demux_asf: video format : %s\n"), - buf_video_name(this->streams[this->num_streams].buf_type)); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: video format : %s\n"), + buf_video_name(this->streams[this->num_streams].buf_type)); buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->content = buf->mem; @@ -428,7 +409,7 @@ static int asf_read_header (demux_asf_t *this) { get_guid(this, &g); if (memcmp(&g, &asf_header, sizeof(GUID))) { - LOG_MSG(this->xine, _("demux_asf: file doesn't start with an asf header\n")); + printf ("demux_asf: file doesn't start with an asf header\n"); return 0; } get_le64(this); @@ -462,8 +443,9 @@ static int asf_read_header (demux_asf_t *this) { else this->rate = 0; - LOG_MSG(this->xine, _("demux_asf: stream length is %d sec, rate is %d bytes/sec\n"), - this->length, this->rate); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: stream length is %d sec, rate is %d bytes/sec\n"), + this->length, this->rate); start_time = get_le32(this); /* start timestamp in 1/1000 s*/ @@ -513,7 +495,7 @@ 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; - LOG_MSG(this->xine, _("demux_asf: audio conceal interleave detected (%d x %d x %d)\n"), + printf ("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; @@ -612,7 +594,7 @@ static int asf_get_packet(demux_asf_t *this) { if (this->packet_flags & 0x40) { get_le16(this); - LOG_MSG(this->xine, _("demux_asf: absolute size ignored\n")); + printf ("demux_asf: absolute size ignored\n"); hdr_size += 2; } @@ -647,8 +629,8 @@ static void hexdump (unsigned char *data, int len, xine_t *xine) { int i; for (i=0; i<len; i++) - LOG_MSG(xine, "%02x ", data[i]); - LOG_MSG(xine, "\n"); + printf ( "%02x ", data[i]); + printf ("\n"); } @@ -815,7 +797,7 @@ static void asf_send_buffer_defrag (demux_asf_t *this, asf_stream_t *stream, } if( stream->frag_offset + frag_len > DEFRAG_BUFSIZE ) { - LOG_MSG(this->xine, _("demux_asf: buffer overflow on defrag!\n")); + printf ("demux_asf: buffer overflow on defrag!\n"); } else { this->input->read (this->input, &stream->buffer[stream->frag_offset], frag_len); @@ -846,7 +828,7 @@ static void asf_read_packet(demux_asf_t *this) { this->input->seek (this->input, this->packet_size_left, SEEK_CUR); if (!asf_get_packet(this)) { - LOG_MSG(this->xine, _("demux_asf: get_packet failed\n")); + printf ("demux_asf: get_packet failed\n"); this->status = DEMUX_FINISHED; return ; } @@ -880,7 +862,7 @@ static void asf_read_packet(demux_asf_t *this) { this->packet_size_left -= 4; break; default: - LOG_MSG(this->xine, _("demux_asf: unknow segtype %x\n"), this->segtype); + printf ("demux_asf: unknow segtype %x\n", this->segtype); frag_offset = get_le32(this); this->packet_size_left -= 4; break; @@ -1059,7 +1041,7 @@ static void demux_asf_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_asf: stop...ignored\n")); + printf ("demux_asf: stop...ignored\n"); return; } @@ -1145,10 +1127,14 @@ static void demux_asf_start (demux_plugin_t *this_gen, return; } - LOG_MSG(this->xine, _("demux_asf: title : %s\n"), this->title); - LOG_MSG(this->xine, _("demux_asf: author : %s\n"), this->author); - LOG_MSG(this->xine, _("demux_asf: copyright : %s\n"), this->copyright); - LOG_MSG(this->xine, _("demux_asf: comment : %s\n"), this->comment); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: title : %s\n"), this->title); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: author : %s\n"), this->author); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: copyright : %s\n"), this->copyright); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_asf: comment : %s\n"), this->comment); /* * seek to start position @@ -1176,8 +1162,8 @@ static void demux_asf_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_asf_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_asf: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_asf: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -1250,10 +1236,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_asf_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_asf: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_asf: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 6bb2b1ae3..eb31c2245 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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_avi.c,v 1.63 2002/02/09 07:13:22 guenter Exp $ + * $Id: demux_avi.c,v 1.64 2002/02/17 17:32:49 guenter Exp $ * * demultiplexer for avi streams * @@ -50,20 +50,20 @@ #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ + xine_log(xine, XINE_LOG_FORMAT, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ + xine_log(xine, XINE_LOG_FORMAT, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_FORMAT, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_FORMAT, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif @@ -849,7 +849,7 @@ static void *demux_avi_loop (void *this_gen) { } } - LOG_MSG(this->xine, _("demux_avi: demux loop finished.\n")); + printf ("demux_avi: demux loop finished.\n"); pthread_exit(NULL); @@ -863,7 +863,7 @@ static void demux_avi_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_avi: stop...ignored\n")); + printf ("demux_avi: stop...ignored\n"); return; } @@ -1100,13 +1100,13 @@ static int demux_avi_open(demux_plugin_t *this_gen, if (this->avi) { - LOG_MSG(this->xine, _("demux_avi: %ld frames\n"), this->avi->video_frames); + printf ("demux_avi: %ld frames\n", this->avi->video_frames); strncpy(this->last_mrl, input->get_mrl (input), 1024); return DEMUX_CAN_HANDLE; } else - LOG_MSG(this->xine, _("demux_avi: AVI_init failed (AVI_errno: %d)\n"), this->AVI_errno); + printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n", this->AVI_errno); return DEMUX_CANNOT_HANDLE; } @@ -1143,7 +1143,7 @@ static int demux_avi_open(demux_plugin_t *this_gen, strncpy(this->last_mrl, input->get_mrl (input), 1024); return DEMUX_CAN_HANDLE; } else { - LOG_MSG(this->xine, _("demux_avi: AVI_init failed (AVI_errno: %d)\n"), + printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n", this->AVI_errno); return DEMUX_CANNOT_HANDLE; } diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c index d5fd46b0f..55e8b5be5 100644 --- a/src/demuxers/demux_cda.c +++ b/src/demuxers/demux_cda.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_cda.c,v 1.7 2002/02/09 07:13:22 guenter Exp $ + * $Id: demux_cda.c,v 1.8 2002/02/17 17:32:49 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -36,26 +36,6 @@ #include "compat.h" #include "demux.h" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - #define DEMUX_CDA_IFACE_VERSION 3 typedef struct { @@ -152,7 +132,7 @@ static void demux_cda_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_cda: stop...ignored\n")); + printf ("demux_cda: stop...ignored\n"); return; } @@ -227,7 +207,7 @@ static void demux_cda_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_cda_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_cda: can't create new thread (%s)\n"), strerror(err)); + printf ("demux_cda: can't create new thread (%s)\n", strerror(err)); exit(1); } } @@ -302,10 +282,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_cda_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_cda: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_cda: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index 608c74fa0..e48182520 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.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_elem.c,v 1.33 2002/02/09 07:13:22 guenter Exp $ + * $Id: demux_elem.c,v 1.34 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for elementary mpeg streams * @@ -45,26 +45,6 @@ #define VALID_ENDS ".mpv" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - typedef struct { demux_plugin_t demux_plugin; @@ -247,8 +227,8 @@ static void demux_mpeg_elem_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_mpeg_elem_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_elem: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_elem: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -359,10 +339,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpeg_elem_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_elem: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_elem: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index ddfc39cfc..6a4bfd4a1 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.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_mpeg.c,v 1.49 2002/02/09 07:13:22 guenter Exp $ + * $Id: demux_mpeg.c,v 1.50 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -45,26 +45,6 @@ #define VALID_MRLS "stdin,fifo" #define VALID_ENDS "mpg,mpeg,mpe" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - #define NUM_PREVIEW_BUFFERS 150 typedef struct demux_mpeg_s { @@ -126,8 +106,7 @@ static uint32_t read_bytes (demux_mpeg_t *this, int n) { res = (buf[2]<<8) | buf[3] | (buf[1]<<16) | (buf[0] << 24); break; default: - LOG_MSG_STDERR(this->xine, - _("How how - something wrong in wonderland demux:read_bytes (%d)\n"), n); + printf ("demux_mpeg: how how - something wrong in wonderland demux:read_bytes (%d)\n", n); exit (1); } @@ -664,7 +643,7 @@ static void *demux_mpeg_loop (void *this_gen) { } } - LOG_MSG(this->xine, _("demux loop finished (status: %d, buf:%x)\n"), + printf ("demux_mpeg: demux loop finished (status: %d, buf:%x)\n", this->status, w); pthread_exit(NULL); @@ -678,7 +657,7 @@ static void demux_mpeg_stop (demux_plugin_t *this_gen) { buf_element_t *buf; void *p; - LOG_MSG(this->xine, _("demux_mpeg: stop...\n")); + printf ("demux_mpeg: stop...\n"); if (this->status != DEMUX_OK) { @@ -781,8 +760,8 @@ static void demux_mpeg_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_mpeg_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_mpeg: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_mpeg: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -870,7 +849,7 @@ static int demux_mpeg_open(demux_plugin_t *this_gen, return DEMUX_CANNOT_HANDLE; } - LOG_MSG_STDERR(this->xine, _("You should specify mpeg(mpeg1/mpeg2) stream type.\n")); + xine_log (this->xine, XINE_LOG_MSG, _("demux_mpeg: please specify mpeg(mpeg1/mpeg2) stream type.\n")); return DEMUX_CANNOT_HANDLE; } } @@ -934,10 +913,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpeg_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_mpeg: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_mpeg: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 53f1a0b86..a3519c6aa 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.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_mpeg_block.c,v 1.76 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_mpeg_block.c,v 1.77 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -45,26 +45,6 @@ #define VALID_MRLS "dvd,stdin,fifo" #define VALID_ENDS "vob" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - #define NUM_PREVIEW_BUFFERS 250 #define DISC_TRESHOLD 90000 @@ -114,7 +94,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m if (buf==NULL) { xine_next_mrl_event_t event; - LOG_MSG(this->xine, _("demux_mpeg_block: read_block failed\n")); + printf ("demux_mpeg_block: read_block failed\n"); /* * check if seamless branching is possible @@ -128,12 +108,12 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m char *next_mrl = event.mrl; - LOG_MSG(this->xine, _("demux_mpeg_block: checking if we can branch to %s\n"), next_mrl); + printf ("demux_mpeg_block: checking if we can branch to %s\n", next_mrl); if (next_mrl && this->input->is_branch_possible && this->input->is_branch_possible (this->input, next_mrl)) { - LOG_MSG(this->xine, _("demux_mpeg_block: branching\n")); + printf ("demux_mpeg_block: branching\n"); this->input->close (this->input); this->input->open (this->input, next_mrl); @@ -263,13 +243,14 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m /* we should now have a PES packet here */ if (p[0] || p[1] || (p[2] != 1)) { - LOG_MSG(this->xine, _("demux_mpeg_block: error! %02x %02x %02x (should be 0x000001) \n"), + printf ("demux_mpeg_block: error! %02x %02x %02x (should be 0x000001)\n", p[0], p[1], p[2]); buf->free_buffer (buf); this->warned++; if (this->warned > 5) { - LOG_MSG(this->xine, _("demux_mpeg_block: too many errors, stopping playback. Maybe this stream is scrambled?\n")); + xine_log (this->xine, XINE_LOG_MSG, + _("demux_mpeg_block: too many errors, stopping playback. Maybe this stream is scrambled?\n")); this->status = DEMUX_FINISHED; } @@ -374,7 +355,9 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m } else { /* mpeg 2 */ /* check PES scrambling_control */ if (((p[6] & 0x30) != 0) && !this->warned) { - LOG_MSG(this->xine, _("demux_mpeg_block: warning: pes header indicates that this stream may be encrypted (encryption mode %d)\n"), (p[6] & 0x30) >> 4); + + xine_log (this->xine, XINE_LOG_MSG, + _("demux_mpeg_block: warning: pes header indicates that this stream may be encrypted (encryption mode %d)\n"), (p[6] & 0x30) >> 4); this->warned = 1; } @@ -488,7 +471,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m switch ((p[5]>>6) & 3) { case 3: /* illegal, use 16-bits? */ default: - LOG_MSG(this->xine, _("illegal lpcm sample format (%d), assume 16-bit samples\n"), + printf ("illegal lpcm sample format (%d), assume 16-bit samples\n", (p[5]>>6) & 3 ); case 0: bits_per_sample = 16; break; case 1: bits_per_sample = 20; break; @@ -648,7 +631,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) { /* we should now have a PES packet here */ if (p[0] || p[1] || (p[2] != 1)) { - LOG_MSG(this->xine, _("demux_mpeg_block: error %02x %02x %02x (should be 0x000001) \n"), + printf ("demux_mpeg_block: error %02x %02x %02x (should be 0x000001) \n", p[0], p[1], p[2]); buf->free_buffer (buf); return rate; @@ -749,7 +732,7 @@ static void demux_mpeg_block_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_mpeg_block: stop...ignored\n")); + printf ("demux_mpeg_block: stop...ignored\n"); return; } @@ -869,8 +852,8 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_mpeg_block_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_mpeg_block: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_mpeg_block: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -886,11 +869,11 @@ static void demux_mpeg_block_accept_input (demux_mpeg_block_t *this, strncpy (this->cur_mrl, input->get_mrl(input), 256); - LOG_MSG(this->xine, _("demux_mpeg_block: mrl %s is new, will estimated bitrate\n"), + printf ("demux_mpeg_block: mrl %s is new, will estimated bitrate\n", this->cur_mrl); } else - LOG_MSG(this->xine, _("demux_mpeg_block: mrl %s is known, estimated bitrate: %d\n"), + printf ("demux_mpeg_block: mrl %s is known, estimated bitrate: %d\n", this->cur_mrl, this->rate * 50 * 8); } @@ -1046,12 +1029,11 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpeg_block_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_mpeg_block: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_mpeg_block: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); - return NULL; + return NULL; } this = xine_xmalloc (sizeof (demux_mpeg_block_t)); diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index df01ac14d..f5860a87b 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.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_mpgaudio.c,v 1.34 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_mpgaudio.c,v 1.35 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -43,26 +43,6 @@ #define VALID_ENDS "mp3,mp2,mpa,mpega" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - typedef struct { demux_plugin_t demux_plugin; @@ -173,7 +153,8 @@ static void mpg123_decode_header(demux_mpgaudio_t *this,unsigned long newhead) tpf /= freqs[sampling_frequency] << lsf; bitrate = (double) framesize / tpf; - LOG_MSG(this->xine, _("mpgaudio: bitrate = %.2fkbps\n"), bitrate/1024.0*8.0 ); + xine_log (this->xine, XINE_LOG_FORMAT, + _("mpgaudio: bitrate = %.2fkbps\n"), bitrate/1024.0*8.0 ); this->stream_length = (int)(this->input->get_length(this->input) / bitrate); } @@ -262,7 +243,7 @@ static void demux_mpgaudio_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_mpgaudio_block: stop...ignored\n")); + printf ("demux_mpgaudio_block: stop...ignored\n"); return; } @@ -366,8 +347,8 @@ static void demux_mpgaudio_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_mpgaudio_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_mpgaudio: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_mpgaudio: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -464,10 +445,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpgaudio_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_mpeg: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_mpeg: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index c1382cbdb..941c4512b 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.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_ogg.c,v 1.14 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_ogg.c,v 1.15 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for ogg streams * @@ -46,26 +46,6 @@ #define VALID_ENDS "ogg" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - typedef struct demux_ogg_s { demux_plugin_t demux_plugin; @@ -87,7 +67,7 @@ typedef struct demux_ogg_s { ogg_sync_state oy; ogg_stream_state os; ogg_page og; - + ogg_stream_state oss[MAX_STREAMS]; uint32_t buf_types[MAX_STREAMS]; int num_streams; @@ -124,7 +104,7 @@ static void demux_ogg_send_package (demux_ogg_t *this, int is_content) { cur_serno = ogg_page_serialno (&this->og); if (ogg_page_bos(&this->og)) { - LOG_MSG(this->xine, _("demux_ogg: beginning of stream\ndemux_ogg: serial number %d\n"), + printf ("demux_ogg: beginning of stream\ndemux_ogg: serial number %d\n", ogg_page_serialno (&this->og)); } @@ -140,7 +120,7 @@ static void demux_ogg_send_package (demux_ogg_t *this, int is_content) { stream_num = this->num_streams; this->buf_types[stream_num] = 0; - LOG_MSG(this->xine, _("demux_ogg: found a new stream, serialnumber %d\n"), cur_serno); + printf ("demux_ogg: found a new stream, serialnumber %d\n", cur_serno); this->num_streams++; } @@ -155,9 +135,18 @@ static void demux_ogg_send_package (demux_ogg_t *this, int is_content) { /* detect buftype */ if (!strncmp (&op.packet[1], "vorbis", 6)) { this->buf_types[stream_num] = BUF_AUDIO_VORBIS; + + xine_log (this->xine, XINE_LOG_FORMAT, + _("ogg: vorbis audio stream detected\n")); + } else { - LOG_MSG(this->xine, _("demux_ogg: unknown streamtype, signature: >%.8s<\n"), + printf ("demux_ogg: unknown streamtype, signature: >%.8s<\n", op.packet); + + xine_log (this->xine, XINE_LOG_FORMAT, + _("ogg: unknown stream type (signature >%.8s<)\n"), + op.packet); + this->buf_types[stream_num] = BUF_CONTROL_NOP; } } @@ -255,7 +244,7 @@ static void demux_ogg_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_ogg: stop...ignored\n")); + printf ("demux_ogg: stop...ignored\n"); return; } @@ -339,7 +328,7 @@ static void demux_ogg_start (demux_plugin_t *this_gen, off_t cur_pos = this->input->get_current_pos (this->input); /* - if ( (!start_pos) && (start_time)) + if ( (!start_pos) && (start_time)) start_pos = start_time * this->rate; */ @@ -357,8 +346,8 @@ static void demux_ogg_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_ogg_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_ogg: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_ogg: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -430,8 +419,7 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_ogg_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_ogg: plugin doesn't support plugin API version %d.\n" + printf( _("demux_ogg: plugin doesn't support plugin API version %d.\n" " this means there's a version mismatch between xine and this " " demuxer plugin.\nInstalling current demux plugins should help.\n"), iface); diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c index 2a5305aee..b8dc3cd55 100644 --- a/src/demuxers/demux_pes.c +++ b/src/demuxers/demux_pes.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_pes.c,v 1.18 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_pes.c,v 1.19 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for mpeg 2 PES (Packetized Elementary Streams) * reads streams of variable blocksizes @@ -46,26 +46,6 @@ #define VALID_MRLS "fifo,stdin" #define VALID_ENDS "vdr" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - typedef struct demux_pes_s { demux_plugin_t demux_plugin; @@ -122,8 +102,7 @@ static uint32_t read_bytes (demux_pes_t *this, int n) { res = (buf[2]<<8) | buf[3] | (buf[1]<<16) | (buf[0] << 24); break; default: - LOG_MSG_STDERR(this->xine, - _("How how - something wrong in wonderland demux:read_bytes (%d)\n"), n); + printf ("demux_pes: how how - something wrong in wonderland demux:read_bytes (%d)\n", n); exit (1); } @@ -346,7 +325,7 @@ static void *demux_pes_loop (void *this_gen) { } } - LOG_MSG(this->xine, _("demux loop finished (status: %d, buf:%x)\n"), + printf ("demux_pes: demux loop finished (status: %d, buf:%x)\n", this->status, w); pthread_exit(NULL); @@ -360,7 +339,7 @@ static void demux_pes_stop (demux_plugin_t *this_gen) { buf_element_t *buf; void *p; - LOG_MSG(this->xine, _("demux_pes: stop...\n")); + printf ("demux_pes: stop...\n"); if (this->status != DEMUX_OK) { @@ -456,8 +435,8 @@ static void demux_pes_start (demux_plugin_t *this_gen, if ((err = pthread_create (&this->thread, NULL, demux_pes_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_pes: can't create new thread (%s)\n"), - strerror(err)); + printf ("demux_pes: can't create new thread (%s)\n", + strerror(err)); exit (1); } } @@ -586,10 +565,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_pes_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_pes: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_pes: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index a739bfa59..203d1f20e 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.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_qt.c,v 1.20 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_qt.c,v 1.21 2002/02/17 17:32:50 guenter Exp $ * * demultiplexer for quicktime streams, based on: * @@ -56,26 +56,6 @@ #define VALID_ENDS "mov" -#ifdef __GNUC__ -#define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - fprintf(stderr, message, ##args); \ - } -#define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ - printf(message, ##args); \ - } -#else -#define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - fprintf(stderr, __VA_ARGS__); \ - } -#define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ - printf(__VA_ARGS__); \ - } -#endif - /* OpenQuicktime Codec Parameter Types */ #define QUICKTIME_UNKNOWN_PARAMETER -1 #define QUICKTIME_STRING_PARAMETER 0 @@ -3195,8 +3175,8 @@ static int quicktime_read_moov(quicktime_t *file, quicktime_moov_t *moov, quicktime_read_char32(file, (char *)&zlibfourcc); zlibfourcc = quicktime_atom_read_size((char *)&zlibfourcc); - if(zlibfourcc != QT_zlib) - LOG_MSG(xine, _("Header not compressed with zlib\n")); + if (zlibfourcc != QT_zlib) + printf ("demux_qt: header not compressed with zlib\n"); if(compressed_atom.size - 4 > 0) { offset = file->ftell_position + compressed_atom.size - 4; @@ -3217,7 +3197,7 @@ static int quicktime_read_moov(quicktime_t *file, quicktime_moov_t *moov, /* Allocate buffer for compressed header */ cmov_buf = (unsigned char *)malloc( cmov_sz ); if (cmov_buf == 0) { - LOG_MSG_STDERR(xine, _("QT cmov: malloc err 0")); + printf ("demux_qt: QT cmov: malloc err 0"); exit(1); } /* Read in compressed header */ @@ -3225,7 +3205,7 @@ static int quicktime_read_moov(quicktime_t *file, quicktime_moov_t *moov, tlen = file->quicktime_read_data(file, (char*)cmov_buf, cmov_sz); if (tlen != 1) { - LOG_MSG_STDERR(xine, _("QT cmov: read err tlen %llu\n"), tlen); + printf ("demux_qt: QT cmov: read err tlen %llu\n", tlen); free(cmov_buf); return 0; } @@ -3234,7 +3214,7 @@ static int quicktime_read_moov(quicktime_t *file, quicktime_moov_t *moov, moov_sz += 16; /* slop?? */ moov_buf = (unsigned char *)malloc( moov_sz ); if (moov_buf == 0) { - LOG_MSG_STDERR(xine, _("QT cmov: malloc err moov_sz %u\n"), moov_sz); + printf ("demux_qt: QT cmov: malloc err moov_sz %u\n", moov_sz); exit(1); } @@ -3248,12 +3228,12 @@ static int quicktime_read_moov(quicktime_t *file, quicktime_moov_t *moov, zret = inflateInit(&zstrm); if (zret != Z_OK) { - LOG_MSG_STDERR(xine, _("QT cmov: inflateInit err %d\n"), zret); + printf ("demux_qt: QT cmov: inflateInit err %d\n", zret); break; } zret = inflate(&zstrm, Z_NO_FLUSH); if ((zret != Z_OK) && (zret != Z_STREAM_END)) { - LOG_MSG_STDERR(xine, _("QT cmov inflate: ERR %d\n"), zret); + printf ("demux_qt: QT cmov inflate: ERR %d\n", zret); break; } else { FILE *DecOut; @@ -3962,7 +3942,7 @@ static quicktime_t* quicktime_open(input_plugin_t *input, xine_t *xine) if(quicktime_read_info(new_file, xine)) { quicktime_close(new_file); - LOG_MSG(xine, _("demux_qt: quicktime_open: error in header\n")); + printf ("demux_qt: quicktime_open: error in header\n"); new_file = 0; } @@ -4131,7 +4111,7 @@ static void demux_qt_stop (demux_plugin_t *this_gen) { void *p; if (this->status != DEMUX_OK) { - LOG_MSG(this->xine, _("demux_qt: stop...ignored\n")); + printf ("demux_qt: stop...ignored\n"); return; } @@ -4192,13 +4172,13 @@ static int demux_qt_detect_compressors (demux_qt_t *this) { this->bih.biCompression=mmioFOURCC('c', 'v', 'i', 'd'); } - if (!this->video_type ) { - LOG_MSG(this->xine, _("demux_qt: unknown video codec >%s<\n"), video); + if (!this->video_type) { + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_qt: unknown video codec '%s'\n"), video); return 0; } - LOG_MSG(this->xine, _("demux_qt: video codec >%s<\n"), buf_video_name(this->video_type)); - + printf ("demux_qt: video codec is '%s'\n", video); this->wavex.nChannels = quicktime_track_channels (this->qt, 0); this->wavex.nSamplesPerSec = quicktime_sample_rate (this->qt, 0); @@ -4212,13 +4192,16 @@ static int demux_qt_detect_compressors (demux_qt_t *this) { this->has_audio = quicktime_has_audio (this->qt); audio = quicktime_audio_compressor (this->qt, 0); + + printf ("demux_qt: audio codec is '%s'\n", audio); + if (!strncasecmp (audio, "raw ", 4)) { this->audio_type = BUF_AUDIO_LPCM_LE; this->wavex.wFormatTag = WAVE_FORMAT_ADPCM; } else if (!strncasecmp (audio, ".mp3", 4)) { this->audio_type = BUF_AUDIO_MPEG; } else { - LOG_MSG(this->xine, _("demux_qt: unknown audio codec >%s<\n"), + printf ("demux_qt: unknown audio codec >%s<\n", audio); this->audio_type = BUF_CONTROL_NOP; } @@ -4250,12 +4233,13 @@ static void demux_qt_start (demux_plugin_t *this_gen, return; } - LOG_MSG(this->xine, _("demux_qt: video codec %s (%f fps), audio codec %s (%ld Hz, %d bits)\n"), - quicktime_video_compressor (this->qt,0), - quicktime_frame_rate (this->qt,0), - quicktime_audio_compressor (this->qt,0), - quicktime_sample_rate (this->qt,0), - quicktime_audio_bits (this->qt,0)); + xine_log (this->xine, XINE_LOG_FORMAT, + _("demux_qt: video codec %s (%f fps), audio codec %s (%ld Hz, %d bits)\n"), + quicktime_video_compressor (this->qt,0), + quicktime_frame_rate (this->qt,0), + quicktime_audio_compressor (this->qt,0), + quicktime_sample_rate (this->qt,0), + quicktime_audio_bits (this->qt,0)); if (!demux_qt_detect_compressors (this)) { this->status = DEMUX_FINISHED; @@ -4329,7 +4313,7 @@ static void demux_qt_start (demux_plugin_t *this_gen, this->status = DEMUX_OK ; if ((err = pthread_create (&this->thread, NULL, demux_qt_loop, this)) != 0) { - LOG_MSG_STDERR(this->xine, _("demux_qt: can't create new thread (%s)\n"), strerror(err)); + printf ("demux_qt: can't create new thread (%s)\n", strerror(err)); exit (1); } } @@ -4417,10 +4401,9 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_qt_t *this; if (iface != 6) { - LOG_MSG(xine, - _("demux_qt: plugin doesn't support plugin API version %d.\n" - " this means there's a version mismatch between xine and this " - " demuxer plugin.\nInstalling current demux plugins should help.\n"), + printf ("demux_qt: plugin doesn't support plugin API version %d.\n" + " this means there's a version mismatch between xine and this " + " demuxer plugin.\nInstalling current demux plugins should help.\n", iface); return NULL; } diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 44e05147c..6fea5bdac 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.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_ts.c,v 1.36 2002/02/09 07:13:23 guenter Exp $ + * $Id: demux_ts.c,v 1.37 2002/02/17 17:32:50 guenter Exp $ * * Demultiplexer for MPEG2 Transport Streams. * @@ -76,20 +76,20 @@ #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ + xine_log(xine, XINE_LOG_FORMAT, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_DEMUX, message, ##args); \ + xine_log(xine, XINE_LOG_FORMAT, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_FORMAT, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_DEMUX, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_FORMAT, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif @@ -242,8 +242,8 @@ static void demux_ts_parse_pat (demux_ts *this, unsigned char *original_pkt, * indicator set. */ if (!pusi) { - LOG_MSG (this->xine, _("demux_ts: demux error! PAT without payload unit " - "start indicator\n")); + printf ("demux_ts: demux error! PAT without payload unit " + "start indicator\n"); return; } @@ -252,7 +252,7 @@ static void demux_ts_parse_pat (demux_ts *this, unsigned char *original_pkt, */ pkt += pkt[4]; if (pkt - original_pkt > PKT_SIZE) { - LOG_MSG (this->xine, _("demux_ts: demux error! PAT with invalid pointer\n")); + printf ("demux_ts: demux error! PAT with invalid pointer\n"); return; } table_id = (unsigned int)pkt[5] ; diff --git a/src/input/input_cda.c b/src/input/input_cda.c index 150ca05a0..8f9ea52ba 100644 --- a/src/input/input_cda.c +++ b/src/input/input_cda.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_cda.c,v 1.16 2002/01/15 13:20:59 jkeil Exp $ + * $Id: input_cda.c,v 1.17 2002/02/17 17:32:50 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -93,20 +93,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 7f5b1cc63..9dfabe073 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.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_dvd.c,v 1.42 2002/01/02 18:16:07 jkeil Exp $ + * $Id: input_dvd.c,v 1.43 2002/02/17 17:32:50 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -56,20 +56,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_file.c b/src/input/input_file.c index ac0b1f858..08d1e8839 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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_file.c,v 1.38 2002/01/18 22:43:43 f1rmb Exp $ + * $Id: input_file.c,v 1.39 2002/02/17 17:32:50 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -45,20 +45,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_http.c b/src/input/input_http.c index 9193bc5f6..8968dd77d 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -44,20 +44,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_net.c b/src/input/input_net.c index c89c25524..cdb0c383a 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -60,12 +60,12 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index 0e8c4bb5f..2d6097992 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -88,20 +88,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index aa5e3627d..e64967274 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.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_stdin_fifo.c,v 1.19 2002/01/02 18:16:07 jkeil Exp $ + * $Id: input_stdin_fifo.c,v 1.20 2002/02/17 17:32:50 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -44,20 +44,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index b221cd86b..8d94a771d 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.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_vcd.c,v 1.36 2002/01/18 23:16:05 f1rmb Exp $ + * $Id: input_vcd.c,v 1.37 2002/02/17 17:32:50 guenter Exp $ * */ @@ -55,20 +55,20 @@ extern int errno; #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_INPUT, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_INPUT, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 5b8cbed14..d3639e882 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -40,7 +40,9 @@ #define LOG_PAN_SCAN */ +/* #define LOG +*/ #define BUFFER_SIZE (224 * 1024) @@ -253,6 +255,11 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, || (picture->frame_width != picture->coded_picture_width) || (picture->frame_height != picture->coded_picture_height)) { xine_frame_change_event_t notify_event; + + xine_log (mpeg2dec->xine, XINE_LOG_FORMAT, + "libmpeg2: frame size is %d x %d, ratio is %d\n", + picture->frame_width, picture->frame_height, + picture->frame_rate_code); printf ("libmpeg2: frame size has changed to from %d x %d to %d x %d\n", picture->frame_width, picture->frame_height, @@ -565,7 +572,11 @@ void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec, picture->frame_width = picture->coded_picture_width; picture->frame_height = picture->coded_picture_height; - printf ("mpeg2dec: frame size %d x %d\n", + xine_log (mpeg2dec->xine, XINE_LOG_FORMAT, + "libmpeg2: frame size is %d x %d\n", + picture->frame_width, picture->frame_height); + + printf ("libmpeg2: frame size %d x %d\n", picture->frame_width, picture->frame_height); notify_event.event.type = XINE_EVENT_FRAME_CHANGE; diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c index 0a486f0f9..21157d3c4 100644 --- a/src/libmpeg2/header.c +++ b/src/libmpeg2/header.c @@ -184,7 +184,7 @@ static int header_process_sequence_extension (picture_t * picture, picture->coded_picture_height = (picture->coded_picture_height + 31) & ~31; - printf ("libmpeg2: low_delay : %d\n", picture->low_delay); + /* printf ("libmpeg2: low_delay : %d\n", picture->low_delay); */ /* printf ("libmpeg2: sequence extension+5 : %08x (%d)\n", diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c index b5c40788c..91274771a 100644 --- a/src/libmpeg2/xine_decoder.c +++ b/src/libmpeg2/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.22 2002/02/11 01:55:20 guenter Exp $ + * $Id: xine_decoder.c,v 1.23 2002/02/17 17:32:50 guenter Exp $ * * stuff needed to turn libmpeg2 into a xine decoder plugin */ @@ -36,8 +36,9 @@ #include "buffer.h" #include "xine_internal.h" +/* #define LOG - +*/ typedef struct mpeg2dec_decoder_s { video_decoder_t video_decoder; @@ -54,7 +55,9 @@ static void mpeg2dec_init (video_decoder_t *this_gen, vo_instance_t *video_out) mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen; +#ifdef LOG printf ("libmpeg2: init... \n"); +#endif pthread_mutex_lock (&this->lock); @@ -64,13 +67,17 @@ static void mpeg2dec_init (video_decoder_t *this_gen, vo_instance_t *video_out) pthread_mutex_unlock (&this->lock); +#ifdef LOG printf ("libmpeg2: init...done\n"); +#endif } static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen; +#ifdef LOG printf ("libmpeg2: decode_data...\n"); +#endif pthread_mutex_lock (&this->lock); @@ -84,7 +91,9 @@ static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) pthread_mutex_unlock (&this->lock); +#ifdef LOG printf ("libmpeg2: decode_data...done\n"); +#endif } static void mpeg2dec_flush (video_decoder_t *this_gen) { @@ -102,7 +111,9 @@ static void mpeg2dec_close (video_decoder_t *this_gen) { mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen; +#ifdef LOG printf ("libmpeg2: close\n"); +#endif pthread_mutex_lock (&this->lock); diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 169919f2b..7f73ebbc1 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.58 2002/02/09 07:13:24 guenter Exp $ + * $Id: audio_decoder.c,v 1.59 2002/02/17 17:32:50 guenter Exp $ * * * functions that implement audio decoding @@ -212,8 +212,12 @@ void *audio_decoder_loop (void *this_gen) { if (decoder) { xine_event_t event; - printf ("audio_loop: using decoder >%s< \n", + printf ("audio_decoder: using decoder >%s< \n", decoder->get_identifier()); + xine_log (this, XINE_LOG_FORMAT, + "using audio decoder plugin '%s'\n", + decoder->get_identifier()); + this->cur_audio_decoder_plugin = decoder; this->cur_audio_decoder_plugin->init (this->cur_audio_decoder_plugin, this->audio_out); diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 2eca26b8f..1ab098f6a 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.40 2002/02/09 07:13:24 guenter Exp $ + * $Id: audio_out.c,v 1.41 2002/02/17 17:32:50 guenter Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -389,6 +389,10 @@ static int ao_open(ao_instance_t *this, int output_sample_rate, err; + xine_log (this->xine, XINE_LOG_FORMAT, + "stream audio format is %d kHz sampling rate, %d bits. mode is %d.\n", + rate, bits, mode); + if ((output_sample_rate=this->driver->open(this->driver,bits,(this->force_rate ? this->force_rate : rate),mode)) == 0) { printf("audio_out: open failed!\n"); return 0; @@ -531,17 +535,18 @@ static int ao_set_property (ao_instance_t *this, int property, int value) { return(this->driver->set_property(this->driver, property, value)); } -ao_instance_t *ao_new_instance (ao_driver_t *driver, metronom_t *metronom, - config_values_t *config) { - - ao_instance_t *this; - int i; - static char *resample_modes[] = {"auto", "off", "on", NULL}; +ao_instance_t *ao_new_instance (ao_driver_t *driver, xine_t *xine) { + + config_values_t *config = xine->config; + ao_instance_t *this; + int i; + static char *resample_modes[] = {"auto", "off", "on", NULL}; this = xine_xmalloc (sizeof (ao_instance_t)) ; this->driver = driver; - this->metronom = metronom; + this->metronom = xine->metronom; + this->xine = xine; this->open = ao_open; this->get_buffer = ao_get_buffer; diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 23e987560..d864be464 100644 --- a/src/xine-engine/audio_out.h +++ b/src/xine-engine/audio_out.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: audio_out.h,v 1.23 2002/02/09 07:13:24 guenter Exp $ + * $Id: audio_out.h,v 1.24 2002/02/17 17:32:50 guenter Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -184,6 +184,7 @@ struct ao_instance_s { ao_driver_t *driver; metronom_t *metronom; + xine_t *xine; int audio_loop_running; int audio_paused; @@ -210,7 +211,7 @@ struct ao_instance_s { /* This initiates the audio_out sync routines * found in ./src/xine-engine/audio_out.c */ -ao_instance_t *ao_new_instance (ao_driver_t *driver, metronom_t *metronom, config_values_t *config) ; +ao_instance_t *ao_new_instance (ao_driver_t *driver, xine_t *xine) ; /* * to build a dynamic audio output plugin, * you have to implement these driver: diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 2f3b127e0..7a04735c4 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.55 2002/02/17 15:53:28 guenter Exp $ + * $Id: metronom.c,v 1.56 2002/02/17 17:32:50 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -50,7 +50,7 @@ #define METRONOM_REPORT /* -#define METRONOM_LOG +#define LOG */ /* @@ -239,7 +239,7 @@ static void metronom_set_audio_rate (metronom_t *this, int64_t pts_per_smpls) { pthread_mutex_unlock (&this->lock); -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: %lld pts per %d samples\n", pts_per_smpls, AUDIO_SAMPLE_NUM); #endif @@ -331,7 +331,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { diff = pts - predicted_pts; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: got video pts %lld, predicted %lld (= %lld + %lld) => diff %lld\n", pts, predicted_pts, this->last_video_pts, duration, diff); #endif @@ -340,7 +340,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { pts_discontinuity = 1; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: this is a video discontinuity\n"); #endif @@ -350,7 +350,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { */ if( !this->video_discontinuity ) { pts = 0; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: not expecting a video discontinuity => ignored\n"); #endif } @@ -413,7 +413,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { diff = this->video_vpts - vpts; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: video diff is %lld (predicted %lld, given %lld)\n", diff, this->video_vpts, vpts); #endif @@ -424,7 +424,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { /* following line is useless (wrap_offset=wrap_offset) */ /* this->video_wrap_offset = vpts - pts; */ -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: video jump, wrap offset is now %lld\n", this->video_wrap_offset); #endif @@ -435,7 +435,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { /* make wrap_offset consistent with the drift correction */ this->video_wrap_offset = this->video_vpts - pts; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: video drift, wrap offset is now %lld\n", this->video_wrap_offset); #endif @@ -448,7 +448,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { img->vpts = this->video_vpts + this->av_offset; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: video vpts for %10lld : %10lld\n", pts, this->video_vpts); #endif @@ -495,7 +495,7 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, int64_t vpts; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: got %d samples, pts is %lld, last_pts is %lld, diff = %lld\n", nsamples, pts, this->last_audio_pts, pts - this->last_audio_pts); #endif @@ -594,7 +594,7 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, this->audio_vpts += nsamples * (this->audio_pts_delta + this->pts_per_smpls) / AUDIO_SAMPLE_NUM; this->num_audio_samples_guessed += nsamples; -#ifdef METRONOM_LOG +#ifdef LOG printf ("metronom: audio vpts for %10lld : %10lld\n", pts, vpts); #endif diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index d14467557..d8b55dbf9 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.72 2002/02/09 07:13:24 guenter Exp $ + * $Id: video_decoder.c,v 1.73 2002/02/17 17:32:51 guenter Exp $ * */ @@ -232,6 +232,9 @@ void *video_decoder_loop (void *this_gen) { printf ("video_decoder: using decoder >%s< \n", decoder->get_identifier()); + + xine_log (this, XINE_LOG_FORMAT, "using video decoder plugin '%s'\n", + decoder->get_identifier()); } diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 4e7d349a8..b864cb116 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.74 2002/02/17 15:53:28 guenter Exp $ + * $Id: video_out.c,v 1.75 2002/02/17 17:32:51 guenter Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -42,27 +42,27 @@ #ifdef __GNUC__ #define LOG_MSG_STDERR(xine, message, args...) { \ - xine_log(xine, XINE_LOG_VIDEO, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ fprintf(stderr, message, ##args); \ } #define LOG_MSG(xine, message, args...) { \ - xine_log(xine, XINE_LOG_VIDEO, message, ##args); \ + xine_log(xine, XINE_LOG_MSG, message, ##args); \ printf(message, ##args); \ } #else #define LOG_MSG_STDERR(xine, ...) { \ - xine_log(xine, XINE_LOG_VIDEO, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ fprintf(stderr, __VA_ARGS__); \ } #define LOG_MSG(xine, ...) { \ - xine_log(xine, XINE_LOG_VIDEO, __VA_ARGS__); \ + xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \ printf(__VA_ARGS__); \ } #endif - +/* #define LOG - +*/ #define NUM_FRAME_BUFFERS 15 diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 1329dde12..30d794119 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.103 2002/02/09 07:13:24 guenter Exp $ + * $Id: xine.c,v 1.104 2002/02/17 17:32:51 guenter Exp $ * * top-level xine functions * @@ -269,13 +269,13 @@ static int find_demuxer(xine_t *this, const char *MRL) { } int xine_play (xine_t *this, char *mrl, - int start_pos, int start_time) { + int start_pos, int start_time) { double share ; off_t pos, len; int i; - LOG_MSG(this, _("xine_play: xine open %s, start pos = %d, start time = %d (sec)\n"), + printf ("xine_play: xine open %s, start pos = %d, start time = %d (sec)\n", mrl, start_pos, start_time); pthread_mutex_lock (&this->xine_lock); @@ -323,9 +323,14 @@ int xine_play (xine_t *this, char *mrl, return 0; } - LOG_MSG(this, _("xine: using input plugin >%s< for this MRL (%s).\n"), + printf ("xine: using input plugin >%s< for this MRL (%s).\n", this->cur_input_plugin->get_identifier(this->cur_input_plugin), mrl); + xine_log (this, XINE_LOG_FORMAT, + _("using input plugin '%s' for MRL '%s'\n"), + this->cur_input_plugin->get_identifier(this->cur_input_plugin), + mrl); + /* * find demuxer plugin */ @@ -337,9 +342,13 @@ int xine_play (xine_t *this, char *mrl, return 0; } - LOG_MSG(this, _("xine: using demuxer plugin >%s< for this MRL.\n"), + printf ("xine: using demuxer plugin >%s< for this MRL.\n", this->cur_demuxer_plugin->get_identifier()); + xine_log (this, XINE_LOG_FORMAT, + _("system layer format '%s' detected.\n"), + this->cur_demuxer_plugin->get_identifier()); + /* * start demuxer */ @@ -511,7 +520,7 @@ xine_t *xine_init (vo_driver_t *vo, update_osd_display, this ); if(ao) - this->audio_out = ao_new_instance (ao, this->metronom, config); + this->audio_out = ao_new_instance (ao, this); audio_decoder_init (this); @@ -854,13 +863,9 @@ unsigned int xine_get_log_section_count(void) { const char **xine_get_log_names(void) { static const char *log_sections[XINE_LOG_NUM + 1]; - log_sections[XINE_LOG_MSG] = _("messages"); /* XINE_LOG_MSG */ - log_sections[XINE_LOG_INPUT] = _("inputs"); /* XINE_LOG_INPUT */ - log_sections[XINE_LOG_DEMUX] = _("demuxers"); /* XINE_LOG_DEMUX */ - log_sections[XINE_LOG_CODEC] = _("codecs"); /* XINE_LOG_CODEC */ - log_sections[XINE_LOG_VIDEO] = _("video"); /* XINE_LOG_VIDEO */ - log_sections[XINE_LOG_METRONOM] = _("metronom"); /* XINE_LOG_METRONOM */ - log_sections[XINE_LOG_PLUGIN] = _("plugin"); /* XINE_LOG_PLUGIN */ + log_sections[XINE_LOG_MSG] = _("messages"); + log_sections[XINE_LOG_FORMAT] = _("stream format"); + log_sections[XINE_LOG_PLUGIN] = _("plugin"); log_sections[XINE_LOG_NUM] = NULL; return log_sections; diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 88f790fcd..1ce4135e2 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.71 2002/02/06 10:57:15 f1rmb Exp $ + * $Id: xine_internal.h,v 1.72 2002/02/17 17:32:51 guenter Exp $ * */ @@ -138,14 +138,10 @@ struct audio_decoder_s { /* * log output */ -#define XINE_LOG_MSG 0 -#define XINE_LOG_INPUT 1 -#define XINE_LOG_DEMUX 2 -#define XINE_LOG_CODEC 3 -#define XINE_LOG_VIDEO 4 -#define XINE_LOG_METRONOM 5 -#define XINE_LOG_PLUGIN 6 -#define XINE_LOG_NUM 7 /* # of log buffers defined */ +#define XINE_LOG_MSG 0 /* warnings, errors, ... */ +#define XINE_LOG_FORMAT 1 /* stream format, decoders, video size... */ +#define XINE_LOG_PLUGIN 2 +#define XINE_LOG_NUM 3 /* # of log buffers defined */ typedef void (*xine_event_listener_t) (void *user_data, xine_event_t *); |