summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_asf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_asf.c')
-rw-r--r--src/demuxers/demux_asf.c97
1 files changed, 41 insertions, 56 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;
}