summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-11-26 19:43:26 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-11-26 19:43:26 +0000
commit3050d97eb83cfdfb4d04a51231acba47e6addf1c (patch)
tree4337d69086ce7d870214e7e5f6a028f8b417521e /src/demuxers
parentae2a2a8e08ab3140d5c7ee3a5f33e7db81f76b09 (diff)
downloadxine-lib-3050d97eb83cfdfb4d04a51231acba47e6addf1c.tar.gz
xine-lib-3050d97eb83cfdfb4d04a51231acba47e6addf1c.tar.bz2
lprintf cleanup, pass I.
CVS patchset: 5796 CVS date: 2003/11/26 19:43:26
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_4xm.c9
-rw-r--r--src/demuxers/demux_asf.c280
-rw-r--r--src/demuxers/demux_avi.c6
-rw-r--r--src/demuxers/demux_eawve.c9
-rw-r--r--src/demuxers/demux_elem.c9
-rw-r--r--src/demuxers/demux_film.c9
-rw-r--r--src/demuxers/demux_idcin.c5
-rw-r--r--src/demuxers/demux_image.c9
-rw-r--r--src/demuxers/demux_ipmovie.c13
-rw-r--r--src/demuxers/demux_mng.c9
-rw-r--r--src/demuxers/demux_mpeg.c9
-rw-r--r--src/demuxers/demux_mpeg_block.c126
-rw-r--r--src/demuxers/demux_mpeg_pes.c124
-rw-r--r--src/demuxers/demux_mpgaudio.c6
-rw-r--r--src/demuxers/demux_nsv.c9
-rw-r--r--src/demuxers/demux_ogg.c21
-rw-r--r--src/demuxers/demux_real.c11
-rw-r--r--src/demuxers/demux_roq.c9
-rw-r--r--src/demuxers/demux_slave.c9
-rw-r--r--src/demuxers/demux_str.c9
-rw-r--r--src/demuxers/demux_ts.c15
-rw-r--r--src/demuxers/demux_wc3movie.c8
-rw-r--r--src/demuxers/demux_yuv_frames.c11
23 files changed, 298 insertions, 427 deletions
diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c
index 9bd2941ca..c936d1065 100644
--- a/src/demuxers/demux_4xm.c
+++ b/src/demuxers/demux_4xm.c
@@ -23,7 +23,7 @@
* For more information on the 4xm file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_4xm.c,v 1.11 2003/11/16 23:33:42 f1rmb Exp $
+ * $Id: demux_4xm.c,v 1.12 2003/11/26 19:43:27 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,10 +36,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_4xm"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 7a7791825..76a24e4e4 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.142 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_asf.c,v 1.143 2003/11/26 19:43:27 f1rmb Exp $
*
* demultiplexer for asf streams
*
@@ -39,6 +39,12 @@
#include <string.h>
#include <stdlib.h>
+#define LOG_MODULE "demux_asf"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
#include "xine_internal.h"
#include "demux.h"
#include "xineutils.h"
@@ -46,10 +52,6 @@
#include "asfheader.h"
#include "xmlparser.h"
-/*
-#define LOG
-*/
-
#define CODEC_TYPE_AUDIO 0
#define CODEC_TYPE_VIDEO 1
#define CODEC_TYPE_CONTROL 2
@@ -247,9 +249,7 @@ static int get_guid_id (demux_asf_t *this, GUID g) {
for (i = 1; i < GUID_END; i++) {
if (!memcmp(&g, &guids[i].guid, sizeof(GUID))) {
-#ifdef LOG
- printf ("demux_asf: GUID: %s\n", guids[i].name);
-#endif
+ lprintf ("GUID: %s\n", guids[i].name);
return i;
}
}
@@ -306,9 +306,7 @@ static void asf_send_audio_header (demux_asf_t *this, int stream) {
_x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC, wavex->wFormatTag);
-#ifdef LOG
- printf ("demux_asf: wavex header is %d bytes long\n", this->wavex_size);
-#endif
+ lprintf ("wavex header is %d bytes long\n", this->wavex_size);
buf->size = this->wavex_size;
buf->type = this->streams[stream].buf_type;
@@ -489,9 +487,8 @@ static int asf_read_header (demux_asf_t *this) {
} else
this->streams[this->num_streams].defrag = 0;
-#ifdef LOG
- printf ("demux_asf: found an audio stream id=%d \n", stream_id);
-#endif
+ lprintf ("found an audio stream id=%d \n", stream_id);
+
this->num_audio_streams++;
}
else if (type == CODEC_TYPE_VIDEO) {
@@ -525,10 +522,9 @@ static int asf_read_header (demux_asf_t *this) {
} else
printf ("demux_asf: invalid bih_size received (%d), v_stream ignored.\n", i );
-#ifdef LOG
- printf ("demux_asf: found a video stream id=%d, buf_type=%08x \n",
- stream_id, this->streams[this->num_streams].buf_type);
-#endif
+ lprintf ("found a video stream id=%d, buf_type=%08x \n",
+ stream_id, this->streams[this->num_streams].buf_type);
+
this->num_video_streams++;
}
else if (type == CODEC_TYPE_CONTROL) {
@@ -539,9 +535,8 @@ static int asf_read_header (demux_asf_t *this) {
while (get_byte(this) != 0) {while (get_byte(this) != 0) {}}
while (get_byte(this) != 0) {while (get_byte(this) != 0) {}}
*/
-#ifdef LOG
- printf ("demux_asf: found a control stream id=%d \n", stream_id);
-#endif
+ lprintf ("found a control stream id=%d \n", stream_id);
+
}
this->num_streams++;
@@ -551,9 +546,8 @@ static int asf_read_header (demux_asf_t *this) {
break;
case GUID_ASF_DATA:
-#ifdef LOG
- printf ("demux_asf: found data\n");
-#endif
+ lprintf ("found data\n");
+
goto headers_ok;
break;
case GUID_ASF_CONTENT_DESCRIPTION:
@@ -582,9 +576,7 @@ static int asf_read_header (demux_asf_t *this) {
uint16_t streams, stream_id;
uint16_t i;
-#ifdef LOG
- printf("demux_asf: GUID stream group\n");
-#endif
+ lprintf("GUID stream group\n");
streams = get_le16(this);
for(i = 0; i < streams; i++) {
@@ -741,9 +733,7 @@ static void check_newpts (demux_asf_t *this, int64_t pts, int video, int frame_e
if (pts && (this->send_newpts || (this->last_pts[video] && abs(diff)>WRAP_THRESHOLD)) ) {
-#ifdef LOG
- printf ("demux_asf: sending newpts %lld (video = %d diff = %lld)\n", pts, video, diff);
-#endif
+ lprintf ("sending newpts %lld (video = %d diff = %lld)\n", pts, video, diff);
if (this->buf_flag_seek) {
_x_demux_control_newpts(this->stream, pts, BUF_FLAG_SEEK);
@@ -769,14 +759,12 @@ static void check_newpts (demux_asf_t *this, int64_t pts, int video, int frame_e
diff = pts - this->last_frame_pts;
if ( (diff>0) && (diff < MAX_FRAME_DUR) ) {
-#ifdef LOG
- printf ("demux_asf: last_frame_pts = %8lld, diff=%8lld\n",
+ lprintf ("last_frame_pts = %8lld, diff=%8lld\n",
this->last_frame_pts, diff);
-#endif
+
this->frame_duration = (15*this->frame_duration + diff) / 16;
-#ifdef LOG
- printf ("demux_asf: frame_duration is %d\n", this->frame_duration);
-#endif
+
+ lprintf ("frame_duration is %d\n", this->frame_duration);
}
}
@@ -794,9 +782,7 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
int bufsize;
int package_done;
-#ifdef LOG
- printf ("demux_asf: asf_send_buffer_nodefrag: timestamp=%lld, pts=%lld\n", timestamp, timestamp * 90);
-#endif
+ lprintf ("asf_send_buffer_nodefrag: timestamp=%lld, pts=%lld\n", timestamp, timestamp * 90);
if ((stream->frag_offset == 0) && (frag_offset == 0)) {
/* new packet */
@@ -838,11 +824,9 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
else
buf->extra_info->input_time = 0;
-#ifdef LOG
- printf ("demux_asf: input pos is %lld, input time is %d\n",
- buf->extra_info->input_pos,
- buf->extra_info->input_time);
-#endif
+ lprintf ("input pos is %lld, input time is %d\n",
+ buf->extra_info->input_pos,
+ buf->extra_info->input_time);
buf->pts = timestamp * 90;
buf->type = stream->buf_type;
@@ -872,10 +856,9 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
stream->frag_offset = 0;
}
-#ifdef LOG
- printf ("demux_asf: buffer type %08x %8d bytes, %8lld pts\n",
- buf->type, buf->size, buf->pts);
-#endif
+ lprintf ("buffer type %08x %8d bytes, %8lld pts\n",
+ buf->type, buf->size, buf->pts);
+
stream->fifo->put (stream->fifo, buf);
}
}
@@ -892,9 +875,7 @@ static void asf_send_buffer_defrag (demux_asf_t *this, asf_stream_t *stream,
printf("asf_send_buffer seq=%d frag_offset=%d frag_len=%d\n",
seq, frag_offset, frag_len );
*/
-#ifdef LOG
- printf ("demux_asf: asf_send_buffer_defrag: timestamp=%lld, pts=%lld\n", timestamp, timestamp * 90);
-#endif
+ lprintf ("asf_send_buffer_defrag: timestamp=%lld, pts=%lld\n", timestamp, timestamp * 90);
if ((stream->frag_offset == 0) && (frag_offset == 0)) {
/* new packet */
@@ -969,10 +950,8 @@ static void asf_send_buffer_defrag (demux_asf_t *this, asf_stream_t *stream,
buf->type = stream->buf_type;
buf->size = bufsize;
-#ifdef LOG
- printf ("demux_asf: buffer type %08x %8d bytes, %8lld pts\n",
- buf->type, buf->size, buf->pts);
-#endif
+ lprintf ("buffer type %08x %8d bytes, %8lld pts\n",
+ buf->type, buf->size, buf->pts);
stream->frag_offset -= bufsize;
p+=bufsize;
@@ -1056,9 +1035,8 @@ static int asf_parse_packet_header(demux_asf_t *this) {
if (ecd_flags & 0x70) {
/* skip invalid packet */
-#ifdef LOG
- printf("demux_asf: skip invalid packet: %d\n", ecd_flags);
-#endif
+ lprintf("skip invalid packet: %d\n", ecd_flags);
+
this->input->seek (this->input, this->packet_size - p_hdr_size, SEEK_CUR);
invalid_packet = 1;
}
@@ -1104,21 +1082,18 @@ static int asf_parse_packet_header(demux_asf_t *this) {
timestamp = get_le32(this); p_hdr_size += 4;
duration = get_le16(this); p_hdr_size += 2;
-#ifdef LOG
- printf ("demux_asf: timestamp=%lld, duration=%lld\n", timestamp, duration);
-#endif
+
+ lprintf ("timestamp=%lld, duration=%lld\n", timestamp, duration);
if ((this->packet_flags >> 5) & 3) {
/* absolute data size */
-#ifdef LOG
- printf ("demux_asf: absolute data size\n");
-#endif
+ lprintf ("absolute data size\n");
+
this->packet_padsize = this->packet_size - this->data_size; /* not used */
} else {
/* relative data size */
-#ifdef LOG
- printf ("demux_asf: relative data size\n");
-#endif
+ lprintf ("relative data size\n");
+
this->data_size = this->packet_size - this->packet_padsize;
}
@@ -1133,9 +1108,8 @@ static int asf_parse_packet_header(demux_asf_t *this) {
if (this->packet_flags & 0x01) {
this->frame_flag = get_byte(this); p_hdr_size += 1;
this->nb_frames = (this->frame_flag & 0x3F);
-#ifdef LOG
- printf ("demux_asf: multiple frames %d\n", this->nb_frames);
-#endif
+
+ lprintf ("multiple frames %d\n", this->nb_frames);
} else {
this->frame_flag = 0;
this->nb_frames = 1;
@@ -1143,10 +1117,8 @@ static int asf_parse_packet_header(demux_asf_t *this) {
/* this->packet_size_left = this->packet_size - p_hdr_size; */
this->packet_size_left = this->data_size - p_hdr_size;
-#ifdef LOG
- printf ("demux_asf: new packet, size = %d, size_left = %d, flags = 0x%02x, padsize = %d, this->packet_size = %d\n",
- this->data_size, this->packet_size_left, this->packet_flags, this->packet_padsize, this->packet_size);
-#endif
+ lprintf ("new packet, size = %d, size_left = %d, flags = 0x%02x, padsize = %d, this->packet_size = %d\n",
+ this->data_size, this->packet_size_left, this->packet_flags, this->packet_padsize, this->packet_size);
return 0;
}
@@ -1166,9 +1138,8 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,
stream_id = raw_id & 0x7f;
*stream = NULL;
-#ifdef LOG
- printf ("demux_asf: got raw_id=%d\n", raw_id);
-#endif
+
+ lprintf ("got raw_id=%d\n", raw_id);
for (i = 0; i < this->num_streams; i++) {
if (this->streams[i].stream_id == stream_id &&
@@ -1207,16 +1178,13 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,
exp_seq = (*stream)->seq + 1;
break;
default:
-#ifdef LOG
- printf ("demux_asf: seq=0\n");
-#endif
+ lprintf ("seq=0\n");
*seq = 0;
}
/* check seq number */
-#ifdef LOG
- printf ("demux_asf: stream_id = %d, seq = %d\n", (*stream)->stream_id, *seq);
-#endif
+ lprintf ("stream_id = %d, seq = %d\n", (*stream)->stream_id, *seq);
+
if (*stream) {
if ((*stream)->first_seq || (*stream)->skip) {
exp_seq = *seq;
@@ -1235,9 +1203,8 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,
(*stream)->fifo->put((*stream)->fifo, buf);
}
if ((*stream)->stream_id == this->video_stream_id) {
-#ifdef LOG
- printf ("demux_asf: bad seq: waiting for keyframe\n");
-#endif
+ lprintf ("bad seq: waiting for keyframe\n");
+
(*stream)->resync = 1;
(*stream)->skip = 1;
this->keyframe_ts = 0;
@@ -1254,9 +1221,7 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,
case 3:
*frag_offset = get_le32(this); s_hdr_size += 4; break;
default:
-#ifdef LOG
- printf ("demux_asf: frag_offset=0\n");
-#endif
+ lprintf ("frag_offset=0\n");
*frag_offset = 0;
}
@@ -1278,10 +1243,9 @@ static int asf_parse_packet_payload_common(demux_asf_t *this,
return 1;
}
-#ifdef LOG
- printf ("demux_asf: segment header, stream id %02x, frag_offset %d, flags : %02x\n",
+ lprintf ("segment header, stream id %02x, frag_offset %d, flags : %02x\n",
stream_id, *frag_offset, *rlen);
-#endif
+
this->packet_size_left -= s_hdr_size;
return 0;
}
@@ -1297,9 +1261,8 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,
uint32_t data_length = 0;
uint32_t data_sent=0;
-#ifdef LOG
- printf ("demux_asf: asf_parse_packet_payload_single\n");
-#endif
+ lprintf ("asf_parse_packet_payload_single\n");
+
*timestamp = frag_offset;
frag_offset = 0;
get_byte (this); s_hdr_size += 1;
@@ -1314,21 +1277,16 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,
case 3:
data_length = get_le32(this); s_hdr_size += 4; break;
default:
-#ifdef LOG
- printf ("demux_asf: invalid frame_flag %d\n", this->frame_flag);
-#endif
+ lprintf ("invalid frame_flag %d\n", this->frame_flag);
data_length = get_le16(this); s_hdr_size += 2;
}
-#ifdef LOG
- printf ("demux_asf: reading grouping part segment, size = %d\n", data_length);
-#endif
+ lprintf ("reading grouping part segment, size = %d\n", data_length);
} else {
data_length = this->packet_size_left - s_hdr_size;
-#ifdef LOG
- printf ("demux_asf: reading grouping single segment, size = %d\n", data_length);
-#endif
+
+ lprintf ("reading grouping single segment, size = %d\n", data_length);
}
if (data_length > this->packet_size_left) {
@@ -1343,10 +1301,7 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,
while (data_sent < data_length) {
int object_length = get_byte(this);
-#ifdef LOG
- printf ("demux_asf: sending grouped object, len = %d\n", object_length);
-#endif
-
+ lprintf ("sending grouped object, len = %d\n", object_length);
if (stream && stream->fifo) {
/* keyframe detection for non-seekable input plugins */
@@ -1364,9 +1319,7 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,
}
if (!stream->skip) {
- #ifdef LOG
- printf ("demux_asf: sending buffer of type %08x\n", stream->buf_type);
- #endif
+ lprintf ("sending buffer of type %08x\n", stream->buf_type);
if (stream->defrag)
asf_send_buffer_defrag (this, stream, 0, seq, *timestamp,
@@ -1375,15 +1328,13 @@ static int asf_parse_packet_payload_single(demux_asf_t *this,
asf_send_buffer_nodefrag (this, stream, 0, seq, *timestamp,
object_length, object_length);
} else {
- #ifdef LOG
- printf ("demux_asf: skip object\n");
- #endif
+ lprintf ("skip object\n");
+
this->input->seek (this->input, object_length, SEEK_CUR);
}
} else {
-#ifdef LOG
- printf ("demux_asf: unhandled stream type\n");
-#endif
+ lprintf ("unhandled stream type\n");
+
this->input->seek (this->input, object_length, SEEK_CUR);
}
seq++;
@@ -1406,10 +1357,9 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,
uint32_t s_hdr_size = 0;
uint32_t payload_size, frag_len;
-#ifdef LOG
- printf ("demux_asf: asf_parse_packet_payload_multiple\n");
-#endif
- if (rlen >= 8) {
+ lprintf ("asf_parse_packet_payload_multiple\n");
+
+ if (rlen >= 8) {
payload_size = get_le32(this); s_hdr_size += 4;
*timestamp = get_le32(this); s_hdr_size += 4;
if (rlen - 8) this->input->seek (this->input, rlen - 8, SEEK_CUR);
@@ -1432,21 +1382,16 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,
case 3:
frag_len = get_le32(this); s_hdr_size += 4; break;
default:
-#ifdef LOG
- printf ("demux_asf: invalid frame_flag %d\n", this->frame_flag);
-#endif
+ lprintf ("invalid frame_flag %d\n", this->frame_flag);
+
frag_len = get_le16(this); s_hdr_size += 2;
}
-#ifdef LOG
- printf ("demux_asf: reading part segment, size = %d\n", frag_len);
-#endif
+ lprintf ("reading part segment, size = %d\n", frag_len);
} else {
frag_len = this->packet_size_left - s_hdr_size;
-#ifdef LOG
- printf ("demux_asf: reading single segment, size = %d\n", frag_len);
-#endif
+ lprintf ("reading single segment, size = %d\n", frag_len);
}
if (frag_len > this->packet_size_left) {
@@ -1480,9 +1425,8 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,
}
if (!stream->skip) {
-#ifdef LOG
- printf ("demux_asf: sending buffer of type %08x\n", stream->buf_type);
-#endif
+ lprintf ("sending buffer of type %08x\n", stream->buf_type);
+
if (stream->defrag)
asf_send_buffer_defrag (this, stream, frag_offset, seq, *timestamp,
frag_len, payload_size);
@@ -1490,15 +1434,13 @@ static int asf_parse_packet_payload_multiple(demux_asf_t *this,
asf_send_buffer_nodefrag (this, stream, frag_offset, seq, *timestamp,
frag_len, payload_size);
} else {
-#ifdef LOG
- printf ("demux_asf: skip fragment\n");
-#endif
+ lprintf ("skip fragment\n");
+
this->input->seek (this->input, frag_len, SEEK_CUR);
}
} else {
-#ifdef LOG
- printf ("demux_asf: unhandled stream type\n");
-#endif
+ lprintf ("unhandled stream type\n");
+
this->input->seek (this->input, frag_len, SEEK_CUR);
}
this->packet_size_left -= frag_len;
@@ -1876,9 +1818,8 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {
}
demux_asf_send_headers_common(this, 1);
-#ifdef LOG
- printf ("demux_asf: send header done\n");
-#endif
+
+ lprintf ("send header done\n");
}
static int demux_asf_seek (demux_plugin_t *this_gen,
@@ -1895,10 +1836,8 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
start_time /= 1000;
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: start_pos = %lld, start_time=%d\n",
- start_pos, start_time);
-#endif
+ lprintf ("demux_asf_seek: start_pos = %lld, start_time=%d\n",
+ start_pos, start_time);
this->status = DEMUX_OK;
@@ -1943,9 +1882,8 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
/* no video stream */
if (this->video_stream_id == -1) {
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: no video stream\n");
-#endif
+ lprintf ("demux_asf_seek: no video stream\n");
+
state = 2;
}
@@ -1958,9 +1896,8 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
start_pos -= (start_pos - this->first_packet_pos) % this->packet_size;
while ((start_pos >= this->first_packet_pos) && (state != 5)){
/* seek to the beginning of the previous packet */
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: seek back\n");
-#endif
+ lprintf ("demux_asf_seek: seek back\n");
+
if (this->input->seek (this->input, start_pos, SEEK_SET) != start_pos) {
printf ("demux_asf: demux_asf_seek: seek failed\n");
goto error;
@@ -1973,9 +1910,9 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
for (this->frame = 0; this->frame < (this->nb_frames & 0x3f); this->frame++) {
raw_id = get_byte(this); this->packet_size_left -= 1;
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: raw_id = %d\n", raw_id);
-#endif
+
+ lprintf ("demux_asf_seek: raw_id = %d\n", raw_id);
+
stream_id = raw_id & 0x7f;
keyframe = raw_id & 0x80;
if (asf_parse_packet_payload_common(this, raw_id, &stream, &frag_offset, &rlen, &seq))
@@ -1993,22 +1930,19 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
if (keyframe && (stream_id == this->video_stream_id) && !frag_offset) {
this->keyframe_ts = ts;
if (this->audio_stream_id == -1) {
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: no audio stream\n");
-#endif
+ lprintf ("demux_asf_seek: no audio stream\n");
+
state = 5;
}
state = 1; /* search an audio packet with pts < keyframe pts */
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: keyframe found at %lld, timestamp = %lld\n", start_pos, ts);
-#endif
+
+ lprintf ("demux_asf_seek: keyframe found at %lld, timestamp = %lld\n", start_pos, ts);
}
} else if (state == 1) {
if ((stream_id == this->audio_stream_id) && ts &&
(ts <= this->keyframe_ts)) {
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: audio packet found at %lld, ts = %lld\n", start_pos, ts);
-#endif
+ lprintf ("demux_asf_seek: audio packet found at %lld, ts = %lld\n", start_pos, ts);
+
state = 5; /* end */
break;
}
@@ -2016,9 +1950,8 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
if ((stream_id == this->audio_stream_id) && !frag_offset) {
this->keyframe_ts = ts;
state = 5; /* end */
-#ifdef LOG
- printf ("demux_asf: demux_asf_seek: audio packet found at %lld, timestamp = %lld\n", start_pos, ts);
-#endif
+
+ lprintf ("demux_asf_seek: audio packet found at %lld, timestamp = %lld\n", start_pos, ts);
}
}
}
@@ -2091,9 +2024,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
if ( (len=input->read (input, buf, 1024)) <= 0)
return NULL;
-#ifdef LOG
- printf ("demux_asf: PREVIEW data unavailable, but seek+read worked.\n");
-#endif
+ lprintf ("PREVIEW data unavailable, but seek+read worked.\n");
} else
return NULL;
@@ -2112,9 +2043,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
return NULL;
}
-#ifdef LOG
- printf ("demux_asf: file starts with an asf header\n");
-#endif
+ lprintf ("file starts with an asf header\n");
break;
@@ -2137,9 +2066,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
strncasecmp(ending, ".wma", 4) ) {
return NULL;
}
-#ifdef LOG
- printf ("demux_asf: extension accepted.\n");
-#endif
+
+ lprintf ("extension accepted.\n");
}
break;
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 8a86840fe..d9faf7011 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_avi.c,v 1.181 2003/11/23 23:20:57 valtri Exp $
+ * $Id: demux_avi.c,v 1.182 2003/11/26 19:43:28 f1rmb Exp $
*
* demultiplexer for avi streams
*
@@ -59,12 +59,12 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_avi"
#define LOG_VERBOSE
/*
-#define LOG
+#define LOG
*/
+
#include "xine_internal.h"
#include "xineutils.h"
#include "demux.h"
diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c
index 7fff96bed..2ee247459 100644
--- a/src/demuxers/demux_eawve.c
+++ b/src/demuxers/demux_eawve.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_eawve.c,v 1.25 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_eawve.c,v 1.26 2003/11/26 19:43:29 f1rmb Exp $
*
* demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format
*
@@ -35,10 +35,11 @@
#include <fcntl.h>
#include <unistd.h>
-/********** logging **********/
#define LOG_MODULE "demux_eawve"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c
index 147a712e6..0aa1a7e90 100644
--- a/src/demuxers/demux_elem.c
+++ b/src/demuxers/demux_elem.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_elem.c,v 1.79 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_elem.c,v 1.80 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for elementary mpeg streams
*/
@@ -34,10 +34,11 @@
#include <unistd.h>
#include <string.h>
-/********** logging **********/
#define LOG_MODULE "demux_elem"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index b6de020aa..40b132183 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -21,7 +21,7 @@
* For more information on the FILM file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_film.c,v 1.71 2003/11/17 05:42:07 tmmm Exp $
+ * $Id: demux_film.c,v 1.72 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -34,9 +34,12 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_film"
-/* #define LOG_VERBOSE */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
/* set DEBUG_FILM_LOAD to dump the frame index after the demuxer loads a
* FILM file */
diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c
index 8f2da7dd4..00e4b943b 100644
--- a/src/demuxers/demux_idcin.c
+++ b/src/demuxers/demux_idcin.c
@@ -65,7 +65,7 @@
* - if any bytes exceed 63, do not shift the bytes at all before
* transmitting them to the video decoder
*
- * $Id: demux_idcin.c,v 1.48 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_idcin.c,v 1.49 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -78,9 +78,8 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_idcin"
-/* #define LOG_VERBOSE */
+#define LOG_VERBOSE
/* define LOG to output information about the A/V chunks that the
* demuxer is dispatching to the engine */
diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c
index 51fa41b73..68a5cb8bf 100644
--- a/src/demuxers/demux_image.c
+++ b/src/demuxers/demux_image.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_image.c,v 1.11 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_image.c,v 1.12 2003/11/26 19:43:30 f1rmb Exp $
*
* image dummy demultiplexer
*/
@@ -34,10 +34,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_image"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c
index b4652b29f..97e435dd7 100644
--- a/src/demuxers/demux_ipmovie.c
+++ b/src/demuxers/demux_ipmovie.c
@@ -23,7 +23,7 @@
* For more information regarding the Interplay MVE file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_ipmovie.c,v 1.19 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_ipmovie.c,v 1.20 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,10 +36,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_ipmovie"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
@@ -377,7 +378,7 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
/* check for the logical maximum palette size
* (3 * 256 + 4 bytes) */
if (opcode_size > 0x304) {
- lprintf("demux_ipmovie: set_palette opcode too large\n");
+ lprintf("set_palette opcode too large\n");
chunk_type = CHUNK_BAD;
break;
}
@@ -392,7 +393,7 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
color_count = LE_16(&scratch[2]);
/* sanity check (since they are 16 bit values) */
if ((first_color > 0xFF) || (first_color + color_count > 0x100)) {
- lprintf("demux_ipmovie: set_palette indices out of range (%d -> %d)\n",
+ lprintf("set_palette indices out of range (%d -> %d)\n",
first_color, first_color + color_count);
chunk_type = CHUNK_BAD;
break;
diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c
index 201802cc7..222d42477 100644
--- a/src/demuxers/demux_mng.c
+++ b/src/demuxers/demux_mng.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_mng.c,v 1.15 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_mng.c,v 1.16 2003/11/26 19:43:30 f1rmb Exp $
*
* demux_mng.c, Demuxer plugin for Multiple-image Network Graphics format
*
@@ -37,10 +37,11 @@
#include <libmng.h>
-/********** logging **********/
#define LOG_MODULE "demux_mng"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index b30d4fd67..e01cfd736 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_mpeg.c,v 1.130 2003/11/18 04:35:14 tmmm Exp $
+ * $Id: demux_mpeg.c,v 1.131 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -35,10 +35,11 @@
#include <unistd.h>
#include <string.h>
-/********** logging **********/
#define LOG_MODULE "demux_mpeg"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "demux.h"
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index d444291dd..59fec5df8 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.201 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_mpeg_block.c,v 1.202 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for mpeg 1/2 program streams
* used with fixed blocksize devices (like dvd/vcd)
@@ -34,14 +34,16 @@
#include <unistd.h>
#include <string.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-
+#define LOG_MODULE "demux_mpeg_block"
+#define LOG_VERBOSE
/*
#define LOG
*/
+#include "xine_internal.h"
+#include "xineutils.h"
+#include "demux.h"
+
#define NUM_PREVIEW_BUFFERS 250
#define DISC_TRESHOLD 90000
@@ -157,9 +159,8 @@ static void check_newpts( demux_mpeg_block_t *this, int64_t pts, int video )
/* check if pts is outside nav pts range. any stream without nav must enter here. */
if( pts > this->nav_last_end_pts || pts < this->nav_last_start_pts )
{
-#ifdef LOG
- printf("demux_mpeg_block: discontinuity detected by pts wrap\n");
-#endif
+ lprintf("discontinuity detected by pts wrap\n");
+
if (this->buf_flag_seek) {
_x_demux_control_newpts(this->stream, pts, BUF_FLAG_SEEK);
this->buf_flag_seek = 0;
@@ -168,9 +169,7 @@ static void check_newpts( demux_mpeg_block_t *this, int64_t pts, int video )
}
this->send_newpts = 0;
} else {
-#ifdef LOG
- printf("demux_mpeg_block: no wrap detected\n" );
-#endif
+ lprintf("no wrap detected\n" );
}
this->last_pts[1-video] = 0;
@@ -189,9 +188,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
this->scr = 0;
this->preview_mode = preview_mode;
-#ifdef LOG
- printf ("demux_mpeg_block: read_block\n");
-#endif
+ lprintf ("read_block\n");
buf = this->input->read_block (this->input, this->video_fifo, this->blocksize);
@@ -220,9 +217,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m
this->audio_fifo->put (this->audio_fifo, cbuf);
}
-#ifdef LOG
- printf ("demux_mpeg_block: type %08x != BUF_DEMUX_BLOCK\n", buf->type);
-#endif
+ lprintf ("type %08x != BUF_DEMUX_BLOCK\n", buf->type);
return;
}
@@ -457,9 +452,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_block_t *this, uint8_
this->scr += ( (p[8] & 0x03 << 7) | (p[9] & 0xFE >> 1) );
*/
-#ifdef LOG
- printf ("demux_mpeg_block: SCR=%lld\n", this->scr);
-#endif
+ lprintf ("SCR=%lld\n", this->scr);
/* mux_rate */
@@ -526,16 +519,13 @@ static int32_t parse_private_stream_2(demux_mpeg_block_t *this, uint8_t *p, buf_
this->last_begin_time = buf->extra_info->input_time;
}
-#ifdef LOG
- printf ("demux_mpeg_block: NAV packet, start pts = %lld, end_pts = %lld\n",
+ lprintf ("NAV packet, start pts = %lld, end_pts = %lld\n",
start_pts, end_pts);
-#endif
if (this->nav_last_end_pts != start_pts && !this->preview_mode) {
-#ifdef LOG
- printf("demux_mpeg_block: discontinuity detected by nav packet\n" );
-#endif
+ lprintf("discontinuity detected by nav packet\n" );
+
if (this->buf_flag_seek) {
_x_demux_control_newpts(this->stream, start_pts, BUF_FLAG_SEEK);
this->buf_flag_seek = 0;
@@ -668,9 +658,7 @@ static int32_t parse_pes_for_pts(demux_mpeg_block_t *this, uint8_t *p, buf_eleme
this->pts |= p[12] << 7 ;
this->pts |= (p[13] & 0xFE) >> 1 ;
-#ifdef LOG
- printf ("demux_mpeg_block: pts = %lld\n", this->pts);
-#endif
+ lprintf ("pts = %lld\n", this->pts);
} else
this->pts = 0;
@@ -719,9 +707,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
buf->pts = this->pts;
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: SPU PACK put on fifo\n");
-#endif
+ lprintf ("SPU PACK put on fifo\n");
return -1;
}
@@ -739,9 +725,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
check_newpts( this, this->pts, PTS_VIDEO );
*/
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: SPU SVCD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
-#endif
+ lprintf ("SPU SVCD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
return -1;
}
@@ -759,9 +743,7 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
check_newpts( this, this->pts, PTS_VIDEO );
*/
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: SPU CVD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
-#endif
+ lprintf ("SPU CVD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
return -1;
}
@@ -875,9 +857,8 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: A52 PACK put on fifo\n");
-#endif
+ lprintf ("A52 PACK put on fifo\n");
+
return -1;
} else {
buf->free_buffer(buf);
@@ -942,9 +923,8 @@ static int32_t parse_private_stream_1(demux_mpeg_block_t *this, uint8_t *p, buf_
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: LPCM PACK put on fifo\n");
-#endif
+ lprintf ("LPCM PACK put on fifo\n");
+
return -1;
} else {
buf->free_buffer(buf);
@@ -977,9 +957,7 @@ static int32_t parse_video_stream(demux_mpeg_block_t *this, uint8_t *p, buf_elem
check_newpts( this, this->pts, PTS_VIDEO );
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: MPEG Video PACK put on fifo\n");
-#endif
+ lprintf ("MPEG Video PACK put on fifo\n");
return -1;
}
@@ -1005,9 +983,8 @@ static int32_t parse_audio_stream(demux_mpeg_block_t *this, uint8_t *p, buf_elem
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_block: MPEG Audio PACK put on fifo\n");
-#endif
+ lprintf ("MPEG Audio PACK put on fifo\n");
+
} else {
buf->free_buffer(buf);
}
@@ -1185,9 +1162,7 @@ static int demux_mpeg_block_estimate_rate (demux_mpeg_block_t *this) {
buf->free_buffer (buf);
}
-#ifdef LOG
- printf("demux_mpeg_block:est_rate=%d\n",rate);
-#endif
+ lprintf("est_rate=%d\n",rate);
return rate;
}
@@ -1347,17 +1322,13 @@ static void demux_mpeg_block_accept_input (demux_mpeg_block_t *this,
strncpy (this->cur_mrl, input->get_mrl(input), 256);
-#ifdef LOG
- printf ("demux_mpeg_block: mrl %s is new\n",
- this->cur_mrl);
-#endif
+ lprintf ("mrl %s is new\n", this->cur_mrl);
- } else
-#ifdef LOG
- printf ("demux_mpeg_block: mrl %s is known, bitrate: %d\n",
- this->cur_mrl, this->rate * 50 * 8)
-#endif
- ;
+ }
+ else {
+ lprintf ("mrl %s is known, bitrate: %d\n",
+ this->cur_mrl, this->rate * 50 * 8);
+ }
}
static int demux_mpeg_block_get_stream_length (demux_plugin_t *this_gen) {
@@ -1406,10 +1377,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->scratch = xine_xmalloc_aligned (512, 4096, (void**) &this->scratch_base);
this->status = DEMUX_FINISHED;
-#ifdef LOG
- printf ("demux_mpeg_block:open_plugin:detection_method=%d\n",
- stream->content_detection_method);
-#endif
+ lprintf ("open_plugin:detection_method=%d\n",
+ stream->content_detection_method);
switch (stream->content_detection_method) {
@@ -1425,9 +1394,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
if (((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) ) {
this->blocksize = input->get_blocksize(input);
-#ifdef LOG
- printf("demux_mpeg_block:open_plugin:blocksize=%d\n",this->blocksize);
-#endif
+ lprintf("open_plugin:blocksize=%d\n",this->blocksize);
if (!this->blocksize)
this->blocksize = demux_mpeg_detect_blocksize( this, input );
@@ -1440,15 +1407,12 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input->seek(input, 0, SEEK_SET);
if (input->read(input, this->scratch, this->blocksize)) {
-#ifdef LOG
- printf("demux_mpeg_block:open_plugin:read worked\n");
-#endif
+ lprintf("open_plugin:read worked\n");
if (this->scratch[0] || this->scratch[1]
|| (this->scratch[2] != 0x01) || (this->scratch[3] != 0xba)) {
-#ifdef LOG
- printf("demux_mpeg_block:open_plugin:scratch failed\n");
-#endif
+ lprintf("open_plugin:scratch failed\n");
+
free (this->scratch_base);
free (this);
return NULL;
@@ -1465,9 +1429,9 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input->seek(input, 0, SEEK_SET);
demux_mpeg_block_accept_input (this, input);
-#ifdef LOG
- printf("demux_mpeg_block:open_plugin:Accepting detection_method XINE_DEMUX_CONTENT_STRATEGY blocksize=%d\n",this->blocksize);
-#endif
+ lprintf("open_plugin:Accepting detection_method XINE_DEMUX_CONTENT_STRATEGY blocksize=%d\n",
+ this->blocksize);
+
break;
}
}
@@ -1513,9 +1477,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
case METHOD_EXPLICIT: {
this->blocksize = input->get_blocksize(input);
-#ifdef LOG
- printf("demux_mpeg_block:open_plugin:blocksize=%d\n",this->blocksize);
-#endif
+ lprintf("open_plugin:blocksize=%d\n",this->blocksize);
if (!this->blocksize &&
((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0))
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index 51706a7fe..d1753d907 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_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_mpeg_pes.c,v 1.17 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_mpeg_pes.c,v 1.18 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for mpeg 2 PES (Packetized Elementary Streams)
* reads streams of variable blocksizes
@@ -38,14 +38,16 @@
#include <unistd.h>
#include <string.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-
+#define LOG_MODULE "demux_mpeg_pes"
+#define LOG_VERBOSE
/*
#define LOG
*/
+#include "xine_internal.h"
+#include "xineutils.h"
+#include "demux.h"
+
#define NUM_PREVIEW_BUFFERS 250
#define DISC_TRESHOLD 90000
@@ -140,9 +142,8 @@ static void check_newpts( demux_mpeg_pes_t *this, int64_t pts, int video )
/* check if pts is outside nav pts range. any stream without nav must enter here. */
if( pts > this->nav_last_end_pts || pts < this->nav_last_start_pts )
{
-#ifdef LOG
- printf("demux_mpeg_pes: discontinuity detected by pts wrap\n");
-#endif
+ lprintf("discontinuity detected by pts wrap\n");
+
if (this->buf_flag_seek) {
_x_demux_control_newpts(this->stream, pts, BUF_FLAG_SEEK);
this->buf_flag_seek = 0;
@@ -151,9 +152,7 @@ static void check_newpts( demux_mpeg_pes_t *this, int64_t pts, int video )
}
this->send_newpts = 0;
} else {
-#ifdef LOG
- printf("demux_mpeg_pes: no wrap detected\n" );
-#endif
+ lprintf("no wrap detected\n" );
}
this->last_pts[1-video] = 0;
@@ -236,9 +235,8 @@ static void demux_mpeg_pes_parse_pack (demux_mpeg_pes_t *this, int preview_mode)
#endif
this->packet_len = p[4] << 8 | p[5];
-#ifdef LOG
- printf("demux_pes: stream_id=0x%x, packet_len=%d\n",this->stream_id, this->packet_len);
-#endif
+ lprintf("stream_id=0x%x, packet_len=%d\n",this->stream_id, this->packet_len);
+
if (this->packet_len <= (buf->max_size - 6)) {
i = this->input->read (this->input, buf->mem+6, (off_t) this->packet_len);
if (i != this->packet_len) {
@@ -248,9 +246,8 @@ static void demux_mpeg_pes_parse_pack (demux_mpeg_pes_t *this, int preview_mode)
}
buf->size = this->packet_len + 6;
} else {
-#ifdef LOG
- printf("Jumbo PES packet length=%d, stream_id=0x%x\n",this->packet_len, this->stream_id);
-#endif
+ lprintf("Jumbo PES packet length=%d, stream_id=0x%x\n",this->packet_len, this->stream_id);
+
i = this->input->read (this->input, buf->mem+6, (off_t) (buf->max_size - 6));
if (i != ( buf->max_size - 6)) {
buf->free_buffer (buf);
@@ -461,9 +458,7 @@ static int32_t parse_program_stream_pack_header(demux_mpeg_pes_t *this, uint8_t
this->scr += ( (p[8] & 0x03 << 7) | (p[9] & 0xFE >> 1) );
*/
-#ifdef LOG
- printf ("demux_mpeg_pes: SCR=%lld\n", this->scr);
-#endif
+ lprintf ("SCR=%lld\n", this->scr);
/* mux_rate */
@@ -540,16 +535,13 @@ static int32_t parse_private_stream_2(demux_mpeg_pes_t *this, uint8_t *p, buf_el
this->last_begin_time = buf->extra_info->input_time;
}
-#ifdef LOG
- printf ("demux_mpeg_pes: NAV packet, start pts = %lld, end_pts = %lld\n",
+ lprintf ("NAV packet, start pts = %lld, end_pts = %lld\n",
start_pts, end_pts);
-#endif
if (this->nav_last_end_pts != start_pts && !this->preview_mode) {
-#ifdef LOG
- printf("demux_mpeg_pes: discontinuity detected by nav packet\n" );
-#endif
+ lprintf("discontinuity detected by nav packet\n" );
+
if (this->buf_flag_seek) {
_x_demux_control_newpts(this->stream, start_pts, BUF_FLAG_SEEK);
this->buf_flag_seek = 0;
@@ -689,9 +681,7 @@ static int32_t parse_pes_for_pts(demux_mpeg_pes_t *this, uint8_t *p, buf_element
this->pts |= (int64_t) p[12] << 7 ;
this->pts |= (int64_t) (p[13] & 0xFE) >> 1 ;
-#ifdef LOG
- printf ("demux_mpeg_pes: pts = %lld\n", this->pts);
-#endif
+ lprintf ("pts = %lld\n", this->pts);
} else
this->pts = 0;
@@ -740,9 +730,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
buf->pts = this->pts;
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: SPU PACK put on fifo\n");
-#endif
+ lprintf ("SPU PACK put on fifo\n");
return this->packet_len + result;
}
@@ -760,9 +748,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
check_newpts( this, this->pts, PTS_VIDEO );
*/
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: SPU SVCD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
-#endif
+ lprintf ("SPU SVCD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
return this->packet_len + result;
}
@@ -780,9 +766,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
check_newpts( this, this->pts, PTS_VIDEO );
*/
this->video_fifo->put (this->video_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: SPU CVD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
-#endif
+ lprintf ("SPU CVD PACK (%lld, %d) put on fifo\n", this->pts, spu_id);
return this->packet_len + result;
}
@@ -806,9 +790,8 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: A52 PACK put on fifo\n");
-#endif
+ lprintf ("A52 PACK put on fifo\n");
+
} else {
buf->free_buffer(buf);
}
@@ -872,9 +855,8 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: LPCM PACK put on fifo\n");
-#endif
+ lprintf ("LPCM PACK put on fifo\n");
+
} else {
buf->free_buffer(buf);
}
@@ -903,9 +885,7 @@ static int32_t parse_private_stream_1(demux_mpeg_pes_t *this, uint8_t *p, buf_el
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: A52 PACK put on fifo\n");
-#endif
+ lprintf ("A52 PACK put on fifo\n");
} else {
buf->free_buffer(buf);
}
@@ -969,11 +949,7 @@ static int32_t parse_video_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_elemen
todo_length -= chunk_length;
}
-
-
-#ifdef LOG
- printf ("demux_mpeg_pes: MPEG Video PACK put on fifo\n");
-#endif
+ lprintf ("MPEG Video PACK put on fifo\n");
return this->packet_len + result;
}
@@ -999,9 +975,7 @@ static int32_t parse_audio_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_elemen
if(this->audio_fifo) {
this->audio_fifo->put (this->audio_fifo, buf);
-#ifdef LOG
- printf ("demux_mpeg_pes: MPEG Audio PACK put on fifo\n");
-#endif
+ lprintf ("MPEG Audio PACK put on fifo\n");
} else {
buf->free_buffer(buf);
}
@@ -1173,9 +1147,7 @@ static int demux_mpeg_pes_estimate_rate (demux_mpeg_pes_t *this) {
}
}
-#ifdef LOG
- printf("demux_mpeg_pes:est_rate=%d\n",rate);
-#endif
+ lprintf("est_rate=%d\n",rate);
return rate;
}
@@ -1305,17 +1277,13 @@ static void demux_mpeg_pes_accept_input (demux_mpeg_pes_t *this,
strncpy (this->cur_mrl, input->get_mrl(input), 256);
-#ifdef LOG
- printf ("demux_mpeg_pes: mrl %s is new\n",
- this->cur_mrl);
-#endif
+ lprintf ("mrl %s is new\n", this->cur_mrl);
- } else
-#ifdef LOG
- printf ("demux_mpeg_pes: mrl %s is known, bitrate: %d\n",
- this->cur_mrl, this->rate * 50 * 8)
-#endif
- ;
+ }
+ else {
+ lprintf ("mrl %s is known, bitrate: %d\n",
+ this->cur_mrl, this->rate * 50 * 8);
+ }
}
static int demux_mpeg_pes_get_stream_length (demux_plugin_t *this_gen) {
@@ -1367,10 +1335,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
/* We need to system header in order to identify is the stream is mpeg1 or mpeg2. */
this->wait_for_program_stream_pack_header=1;
-#ifdef LOG
- printf ("demux_mpeg_pes:open_plugin:detection_method=%d\n",
- stream->content_detection_method);
-#endif
+ lprintf ("open_plugin:detection_method=%d\n",
+ stream->content_detection_method);
switch (stream->content_detection_method) {
@@ -1387,15 +1353,12 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input->seek(input, 0, SEEK_SET);
if (input->read(input, this->scratch, 6)) {
-#ifdef LOG
- printf("demux_mpeg_pes:open_plugin:read worked\n");
-#endif
+ lprintf("open_plugin:read worked\n");
if (this->scratch[0] || this->scratch[1]
|| (this->scratch[2] != 0x01) ) {
-#ifdef LOG
- printf("demux_mpeg_pes:open_plugin:scratch failed\n");
-#endif
+ lprintf("open_plugin:scratch failed\n");
+
free (this->scratch_base);
free (this);
return NULL;
@@ -1416,9 +1379,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input->seek(input, 0, SEEK_SET);
demux_mpeg_pes_accept_input (this, input);
-#ifdef LOG
- printf("demux_mpeg_pes:open_plugin:Accepting detection_method XINE_DEMUX_CONTENT_STRATEGY \n");
-#endif
+ lprintf("open_plugin:Accepting detection_method XINE_DEMUX_CONTENT_STRATEGY \n");
+
break;
}
}
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index efadb6d7c..b5fc2d363 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.127 2003/11/26 19:26:59 mroi Exp $
+ * $Id: demux_mpgaudio.c,v 1.128 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -36,8 +36,6 @@
#include <string.h>
#include <stdlib.h>
-
-/********** logging **********/
#define LOG_MODULE "demux_mpeg_audio"
#define LOG_VERBOSE
/*
@@ -1088,7 +1086,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
case METHOD_BY_EXTENSION: {
char *mrl = input->get_mrl(input);
- lprintf ("demux_mpgaudio: stage by extension %s\n", mrl);
+ lprintf ("stage by extension %s\n", mrl);
if (strncmp (mrl, "ice :/", 6)) {
char *extensions = class_gen->get_extensions (class_gen);
diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c
index 97a47213d..9a62e342a 100644
--- a/src/demuxers/demux_nsv.c
+++ b/src/demuxers/demux_nsv.c
@@ -23,7 +23,7 @@
* For more information regarding the NSV file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_nsv.c,v 1.10 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_nsv.c,v 1.11 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,10 +36,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_nsv"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index 6cda0b596..68b4bfd86 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_ogg.c,v 1.116 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_ogg.c,v 1.117 2003/11/26 19:43:30 f1rmb Exp $
*
* demultiplexer for ogg streams
*
@@ -52,10 +52,11 @@
#include <theora/theora.h>
#endif
-/********** logging **********/
#define LOG_MODULE "demux_ogg"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
@@ -1160,12 +1161,10 @@ static void demux_ogg_send_header (demux_ogg_t *this) {
((int64_t) this->t_info.aspect_numerator * 10000) /
this->t_info.aspect_denominator);
-#ifdef LOG
- printf ("demux_ogg: decoded theora header \n");
- printf (" frameduration %d\n",this->frame_duration);
- printf (" w:%d h:%d \n",this->t_info.frame_width,this->t_info.frame_height);
- printf (" an:%d ad:%d \n",this->t_info.aspect_numerator,this->t_info.aspect_denominator);
-#endif
+ lprintf ("decoded theora header \n");
+ lprintf ("frameduration %d\n",this->frame_duration);
+ lprintf ("w:%d h:%d \n",this->t_info.frame_width,this->t_info.frame_height);
+ lprintf ("an:%d ad:%d \n",this->t_info.aspect_numerator,this->t_info.aspect_denominator);
} else {
/*Rejected stream*/
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
@@ -1283,7 +1282,7 @@ static void demux_ogg_send_content (demux_ogg_t *this) {
this->header_granulepos[stream_num]=op.granulepos;
lprintf ("header with granulepos, remembering granulepos\n");
} else {
- lprintf ("demux_ogg: header => discard\n");
+ lprintf ("header => discard\n");
}
continue;
}
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index f0c613e8a..2565e79d9 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -30,7 +30,7 @@
*
* Based on FFmpeg's libav/rm.c.
*
- * $Id: demux_real.c,v 1.72 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_real.c,v 1.73 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -44,10 +44,11 @@
#include <stdlib.h>
#include <ctype.h>
-/********** logging **********/
#define LOG_MODULE "demux_real"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
@@ -1007,7 +1008,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) {
this->video_fifo->put (this->video_fifo, buf);
size -= fragment_size;
- lprintf ("demux_real: size left %d\n", size);
+ lprintf ("size left %d\n", size);
this->fragment_size += fragment_size;
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c
index 785fd78a4..299f9ddc7 100644
--- a/src/demuxers/demux_roq.c
+++ b/src/demuxers/demux_roq.c
@@ -23,7 +23,7 @@
* For more information regarding the RoQ file format, visit:
* http://www.csse.monash.edu.au/~timf/
*
- * $Id: demux_roq.c,v 1.47 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_roq.c,v 1.48 2003/11/26 19:43:30 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,10 +36,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_roq"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c
index c8c566225..44bf24b03 100644
--- a/src/demuxers/demux_slave.c
+++ b/src/demuxers/demux_slave.c
@@ -21,7 +21,7 @@
*/
/*
- * $Id: demux_slave.c,v 1.9 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_slave.c,v 1.10 2003/11/26 19:43:30 f1rmb Exp $
*
* demuxer for slave "protocol"
* master xine must be started with XINE_PARAM_BROADCASTER_PORT set, that is,
@@ -38,10 +38,11 @@
#include <unistd.h>
#include <string.h>
-/********** logging **********/
#define LOG_MODULE "demux_slave"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c
index 00003d69f..3d69d6cd6 100644
--- a/src/demuxers/demux_str.c
+++ b/src/demuxers/demux_str.c
@@ -24,7 +24,7 @@
* This demuxer handles either raw STR files (which are just a concatenation
* of raw compact disc sectors) or STR files with RIFF headers.
*
- * $Id: demux_str.c,v 1.20 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_str.c,v 1.21 2003/11/26 19:43:31 f1rmb Exp $
*/
/*
@@ -119,10 +119,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_str"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index a3ca2781c..6efce42c4 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.96 2003/11/16 23:33:43 f1rmb Exp $
+ * $Id: demux_ts.c,v 1.97 2003/11/26 19:43:31 f1rmb Exp $
*
* Demultiplexer for MPEG2 Transport Streams.
*
@@ -137,6 +137,12 @@
#include <unistd.h>
#include <string.h>
+#define LOG_MODULE "demux_ts"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
#include "xine_internal.h"
#include "xineutils.h"
#include "demux.h"
@@ -642,10 +648,9 @@ static int demux_ts_parse_pes_header (demux_ts_media *m,
int track, spu_id;
-#ifdef LOG
- printf ("demux_ts: audio buf = %02X %02X %02X %02X %02X %02X %02X %02X\n",
- p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
-#endif
+ lprintf ("audio buf = %02X %02X %02X %02X %02X %02X %02X %02X\n",
+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
+
track = p[0] & 0x0F; /* hack : ac3 track */
/*
* we check the descriptor tag first because some stations
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index ff41cd7ae..e90466b21 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -24,7 +24,7 @@
* For more information on the MVE file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_wc3movie.c,v 1.47 2003/11/16 23:33:44 f1rmb Exp $
+ * $Id: demux_wc3movie.c,v 1.48 2003/11/26 19:43:31 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -39,8 +39,10 @@
/********** logging **********/
#define LOG_MODULE "demux_wc3movie"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c
index c8cd4ce8a..ba4fce30b 100644
--- a/src/demuxers/demux_yuv_frames.c
+++ b/src/demuxers/demux_yuv_frames.c
@@ -20,7 +20,7 @@
*/
/*
- * $Id: demux_yuv_frames.c,v 1.12 2003/11/16 23:33:44 f1rmb Exp $
+ * $Id: demux_yuv_frames.c,v 1.13 2003/11/26 19:43:31 f1rmb Exp $
*
* dummy demultiplexer for raw yuv frames (delivered by v4l)
*/
@@ -35,10 +35,11 @@
#include <string.h>
#include <stdlib.h>
-/********** logging **********/
#define LOG_MODULE "demux_yuv_frames"
-/* #define LOG_VERBOSE */
-/* #define LOG */
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
#include "xine_internal.h"
#include "xineutils.h"
@@ -184,7 +185,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
default:
return NULL;
}
- lprintf ("demux_yuv_frames: input accepted.\n");
+ lprintf ("input accepted.\n");
/*
* if we reach this point, the input has been accepted.