diff options
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_asf.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 10 | ||||
-rw-r--r-- | src/demuxers/demux_elem.c | 8 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg.c | 65 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 28 | ||||
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 9 | ||||
-rw-r--r-- | src/demuxers/demux_ogg.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_pes.c | 31 | ||||
-rw-r--r-- | src/demuxers/demux_qt.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_ts.c | 58 |
10 files changed, 72 insertions, 152 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 20c1f58e5..380b226e2 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.13 2001/11/17 19:39:17 miguelfreitas Exp $ + * $Id: demux_asf.c,v 1.14 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for asf streams * @@ -72,8 +72,6 @@ typedef struct { uint8_t *buffer; } asf_stream_t; -static uint32_t xine_debug; - typedef struct demux_asf_s { demux_plugin_t demux_plugin; @@ -1217,7 +1215,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_asf_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_asf_open; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 3d8dc7c0f..20d498857 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.52 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_avi.c,v 1.53 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for avi streams * @@ -48,8 +48,6 @@ /* The following variable indicates the kind of error */ -static uint32_t xine_debug; - typedef struct { long pos; @@ -720,7 +718,6 @@ static int demux_avi_next (demux_avi_t *this) { if (!this->no_audio && (audio_pts < video_pts)) { /* read audio */ - xprintf (VERBOSE|DEMUX|VAVI, "demux_avi: audio \n"); buf->PTS = audio_pts; buf->SCR = audio_pts; @@ -747,7 +744,6 @@ static int demux_avi_next (demux_avi_t *this) { } else { /* read video */ - xprintf (VERBOSE|DEMUX|VAVI, "demux_avi: video \n"); buf->PTS = video_pts; buf->SCR = video_pts; @@ -771,7 +767,6 @@ static int demux_avi_next (demux_avi_t *this) { this->video_fifo->put (this->video_fifo, buf); } - xprintf (VERBOSE|DEMUX|VAVI, "size : %d\n",buf->size); return (buf->size>0); } @@ -1045,8 +1040,6 @@ static int demux_avi_open(demux_plugin_t *this_gen, mrl = input->get_mrl (input); ending = strrchr(mrl, '.'); - xprintf(VERBOSE|DEMUX, "demux_avi_can_handle: ending %s of %s\n", - ending, mrl); if(ending) { if(!strcasecmp(ending, ".avi")) { @@ -1115,7 +1108,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_avi_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_avi_open; diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index 19ff4a9d6..c3e11d9e9 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.28 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_elem.c,v 1.29 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for elementary mpeg streams * @@ -65,7 +65,6 @@ typedef struct { uint8_t scratch[4096]; } demux_mpeg_elem_t ; -static uint32_t xine_debug; /* * @@ -112,8 +111,6 @@ static void *demux_mpeg_elem_loop (void *this_gen) { } while (this->status == DEMUX_OK) ; - xprintf (VERBOSE|DEMUX, "demux loop finished (status: %d)\n", this->status); - this->status = DEMUX_FINISHED; if (this->send_end_buffers) { @@ -217,7 +214,6 @@ static void demux_mpeg_elem_start (demux_plugin_t *this_gen, /* FIXME: implement time seek */ - xprintf (VERBOSE|DEMUX, "=>seek to %Ld\n",start_pos); this->input->seek (this->input, start_pos, SEEK_SET); } @@ -284,7 +280,6 @@ static int demux_mpeg_elem_open(demux_plugin_t *this_gen, MRL = input->get_mrl (input); suffix = strrchr(MRL, '.'); - xprintf(VERBOSE|DEMUX, "%s: suffix %s of %s\n", __FUNCTION__, suffix, MRL); if(suffix) { if(!strcasecmp(suffix, ".mpv")) { @@ -341,7 +336,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = malloc (sizeof (demux_mpeg_elem_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUX_MPEG_ELEM_IFACE_VERSION; this->demux_plugin.open = demux_mpeg_elem_open; diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index ade2e7961..49d0e62ab 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.44 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_mpeg.c,v 1.45 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -44,8 +44,6 @@ #define NUM_PREVIEW_BUFFERS 150 -static uint32_t xine_debug; - typedef struct demux_mpeg_s { demux_plugin_t demux_plugin; @@ -84,8 +82,6 @@ static uint32_t read_bytes (demux_mpeg_t *this, int n) { if (i != n) { this->status = DEMUX_FINISHED; - - xprintf (VERBOSE|DEMUX, "Unexpected end of stream\n"); } @@ -120,14 +116,10 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) len = read_bytes(this, 2); - xprintf (VERBOSE|DEMUX|MPEG, " mpeg2 packet (len=%d",len); - if (stream_id==0xbd) { int track; - xprintf (VERBOSE|DEMUX|AC3, ",ac3"); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -145,8 +137,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -155,8 +145,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) track = this->dummy_space[0] & 0x0F ; - xprintf (VERBOSE|DEMUX, ", track=%02x", track); - /* contents */ if(this->audio_fifo) @@ -186,8 +174,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) } else if ((stream_id & 0xe0) == 0xc0) { int track = stream_id & 0x1f; - xprintf (VERBOSE|DEMUX|AUDIO, ", audio #%d", track); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -205,8 +191,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -238,8 +222,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) } else if ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) { - xprintf (VERBOSE|DEMUX|VIDEO, ",video"); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -257,8 +239,6 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -285,14 +265,11 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) this->video_fifo->put (this->video_fifo, buf); } else { - xprintf (VERBOSE|DEMUX, ",unknown stream - skipped"); i = this->input->read (this->input, this->dummy_space, len); /* (*this->input->seek) (len,SEEK_CUR); */ } - xprintf (VERBOSE|DEMUX, ")\n"); - } static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) { @@ -303,12 +280,8 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) int pts; buf_element_t *buf = NULL; - xprintf (VERBOSE|DEMUX, " packet ("); - len = read_bytes(this, 2); - xprintf (VERBOSE|DEMUX, "len=%d",len); - pts=0; if (stream_id != 0xbf) { @@ -347,8 +320,6 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) w = read_bytes(this, 2); len -= 2; pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - /* pts = 0; */ } else if ((w & 0xF0) == 0x30) { @@ -366,15 +337,16 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) pts |= (w & 0xFFFE) >> 1; /* printf ("pts2=%d\n",pts); */ - xprintf (VERBOSE|DEMUX|VPTS, ", pts2=%d",pts); /* Decoding Time Stamp */ w = read_bytes(this, 3); len -= 3; w = read_bytes(this, 2); len -= 2; } else { - xprintf (VERBOSE|DEMUX, ", w = %02x",w); + + /* if (w != 0x0f) xprintf (VERBOSE|DEMUX, " ERROR w (%02x) != 0x0F ",w); + */ } } @@ -382,8 +354,6 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) if ((stream_id & 0xe0) == 0xc0) { int track = stream_id & 0x1f; - xprintf (VERBOSE|DEMUX|AUDIO, ", audio #%d", track); - if(this->audio_fifo) { buf = this->input->read_block (this->input, this->audio_fifo, len); } else { @@ -411,7 +381,6 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) } else if ((stream_id & 0xf0) == 0xe0) { - xprintf (VERBOSE|DEMUX|VIDEO, ", video #%d", stream_id & 0x0f); buf = this->input->read_block (this->input, this->video_fifo, len); @@ -433,14 +402,13 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int stream_id, uint32_t scr) this->video_fifo->put (this->video_fifo, buf); } else if (stream_id == 0xbd) { - xprintf (VERBOSE|DEMUX|AC3, ", ac3"); + i = this->input->read (this->input, this->dummy_space, len); } else { - xprintf (VERBOSE|DEMUX, ", unknown (stream_id = %d)",stream_id); + this->input->read (this->input, this->dummy_space, len); } - xprintf (VERBOSE|DEMUX, ")\n"); } static uint32_t parse_pack(demux_mpeg_t *this) { @@ -449,17 +417,13 @@ static uint32_t parse_pack(demux_mpeg_t *this) { int mpeg_version; uint32_t scr; - xprintf (VERBOSE|DEMUX, "pack {\n"); buf = read_bytes (this, 1); - xprintf (VERBOSE|DEMUX|VIDEO, " mpeg version : %02x",buf>>4); if ((buf>>4) == 4) { int stuffing, i; - xprintf (VERBOSE|DEMUX|VIDEO, " => mpeg II \n"); - mpeg_version = 2; /* system_clock_reference */ @@ -491,7 +455,7 @@ static uint32_t parse_pack(demux_mpeg_t *this) { read_bytes (this, 1); } else { - xprintf (VERBOSE|DEMUX|VIDEO, " => mpeg I \n"); + mpeg_version = 1; /* system_clock_reference */ @@ -549,7 +513,6 @@ static uint32_t parse_pack(demux_mpeg_t *this) { if (buf == 0x000001bb) { buf = read_bytes (this, 2); - xprintf (VERBOSE|DEMUX, " system_header (%d +6 bytes)\n",buf); this->input->read (this->input, this->dummy_space, buf); @@ -570,10 +533,8 @@ static uint32_t parse_pack(demux_mpeg_t *this) { parse_mpeg2_packet (this, buf & 0xFF, scr); buf = read_bytes (this, 4); - xprintf (VERBOSE|DEMUX, " code = %08x\n",buf); - } - xprintf (VERBOSE|DEMUX, "}\n"); + } return buf; @@ -586,7 +547,6 @@ static uint32_t parse_pack_preview (demux_mpeg_t *this, int *num_buffers) /* system_clock_reference */ buf = read_bytes (this, 1); - xprintf (VERBOSE|DEMUX|VIDEO, " mpeg version : %02x",buf>>4); if ((buf>>4) == 4) { buf = read_bytes(this, 2); @@ -638,8 +598,6 @@ static uint32_t parse_pack_preview (demux_mpeg_t *this, int *num_buffers) *num_buffers = *num_buffers - 1; } - xprintf (VERBOSE|DEMUX, "}\n"); - return buf; } @@ -647,7 +605,7 @@ static uint32_t parse_pack_preview (demux_mpeg_t *this, int *num_buffers) static void demux_mpeg_resync (demux_mpeg_t *this, uint32_t buf) { while ((buf !=0x000001ba) && (this->status == DEMUX_OK)) { - xprintf (VERBOSE|DEMUX, "resync : %08x\n",buf); + buf = (buf << 8) | read_bytes (this, 1); } } @@ -680,8 +638,6 @@ static void *demux_mpeg_loop (void *this_gen) { } } - xprintf (VERBOSE|DEMUX, "demux loop finished (status: %d, buf:%x)\n", - this->status, w); printf ("demux loop finished (status: %d, buf:%x)\n", this->status, w); @@ -884,8 +840,6 @@ static int demux_mpeg_open(demux_plugin_t *this_gen, } ending = strrchr(MRL, '.'); - xprintf(VERBOSE|DEMUX, "demux_mpeg_can_handle: ending %s of %s\n", - ending, MRL); if(!ending) return DEMUX_CANNOT_HANDLE; @@ -946,7 +900,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_mpeg_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_mpeg_open; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 74c32c062..df44419e7 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.61 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_mpeg_block.c,v 1.62 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -40,8 +40,6 @@ #define NUM_PREVIEW_BUFFERS 250 -static uint32_t xine_debug; - typedef struct demux_mpeg_block_s { demux_plugin_t demux_plugin; @@ -162,8 +160,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m if (p[3] == 0xBA) { /* program stream pack header */ - xprintf (VERBOSE|DEMUX, "program stream pack header\n"); - bMpeg1 = (p[4] & 0x40) == 0; if (bMpeg1) { @@ -229,8 +225,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m int header_len; - xprintf (VERBOSE|DEMUX, "program stream system header\n"); - header_len = (p[4] << 8) | p[5]; p += 6 + header_len; @@ -277,8 +271,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m packet_len = p[4] << 8 | p[5]; stream_id = p[3]; - xprintf (VERBOSE|DEMUX, "packet id = %02x len = %d\n",stream_id, packet_len); - if (bMpeg1) { if (stream_id == 0xBF) { @@ -379,8 +371,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m if((p[0] & 0xE0) == 0x20) { spu_id = (p[0] & 0x1f); - xprintf(VERBOSE|DEMUX, "SPU PES packet, id 0x%03x\n",p[0] & 0x1f); - buf->content = p+1; buf->size = packet_len-1; buf->type = BUF_SPU_PACKAGE + spu_id; @@ -394,7 +384,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m if ((p[0]&0xF0) == 0x80) { - xprintf (VERBOSE|DEMUX|AC3, "ac3 PES packet, track %02x\n",track); /* printf ( "ac3 PES packet, track %02x\n",track); */ buf->content = p+4; @@ -424,7 +413,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m int num_channels; int dynamic_range; - xprintf (VERBOSE|DEMUX,"LPCM packet, len : %d %02x\n",packet_len-4, p[0]); /* * found in http://members.freemail.absa.co.za/ginggs/dvd/mpeg2_lpcm.txt * appears to be correct. @@ -455,9 +443,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m } dynamic_range = p[6]; - xprintf(VERBOSE|DEMUX, "LPCM audio format: %dkHz, %d bit, %d channel\n", - sample_rate/1000, bits_per_sample, num_channels); - buf->decoder_info[1] = sample_rate; buf->decoder_info[2] = bits_per_sample; buf->decoder_info[3] = num_channels; @@ -483,7 +468,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m } else if ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) { - xprintf (VERBOSE|DEMUX, "video %d\n", stream_id); buf->content = p; buf->size = packet_len; @@ -501,8 +485,6 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m track = stream_id & 0x1f; - xprintf (VERBOSE|DEMUX|MPEG, "mpg audio #%d", track); - buf->content = p; buf->size = packet_len; buf->type = BUF_AUDIO_MPEG + track; @@ -517,9 +499,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this, int preview_m return ; - } else { - xprintf (VERBOSE | DEMUX, "unknown packet, id = %x\n",stream_id); - } + } buf->free_buffer (buf); @@ -948,9 +928,6 @@ static int demux_mpeg_block_open(demux_plugin_t *this_gen, ending = strrchr(MRL, '.'); - xprintf(VERBOSE|DEMUX, "demux_mpeg_block_can_handle: ending %s of %s\n", - ending ? ending :"(none)", MRL); - if(!ending) return DEMUX_CANNOT_HANDLE; @@ -1005,7 +982,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_mpeg_block_t)); this->xine = xine; config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_mpeg_block_open; diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 634b9174e..cc7acebad 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.28 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_mpgaudio.c,v 1.29 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -62,7 +62,6 @@ typedef struct { int stream_length; } demux_mpgaudio_t ; -static uint32_t xine_debug; int tabsel_123[2][3][16] = { { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,}, @@ -212,8 +211,6 @@ static void *demux_mpgaudio_loop (void *this_gen) { } while (this->status == DEMUX_OK) ; - xprintf (VERBOSE|DEMUX, "demux loop finished (status: %d)\n", this->status); - this->status = DEMUX_FINISHED; if (this->send_end_buffers) { @@ -324,7 +321,7 @@ static void demux_mpgaudio_start (demux_plugin_t *this_gen, start_pos = start_time * this->input->get_length(this->input) / this->stream_length; - xprintf (VERBOSE|DEMUX, "=>seek to %Ld\n",start_pos); + this->input->seek (this->input, start_pos, SEEK_SET); } @@ -379,7 +376,6 @@ static int demux_mpgaudio_open(demux_plugin_t *this_gen, MRL = input->get_mrl (input); suffix = strrchr(MRL, '.'); - xprintf(VERBOSE|DEMUX, "%s: suffix %s of %s\n", __FUNCTION__, suffix, MRL); if(!suffix) return DEMUX_CANNOT_HANDLE; @@ -446,7 +442,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = malloc (sizeof (demux_mpgaudio_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUX_MPGAUDIO_IFACE_VERSION; this->demux_plugin.open = demux_mpgaudio_open; diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 79338c447..f9d44e3ad 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.9 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_ogg.c,v 1.10 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for ogg streams * @@ -44,8 +44,6 @@ #define MAX_STREAMS 16 -static uint32_t xine_debug; - typedef struct demux_ogg_s { demux_plugin_t demux_plugin; @@ -407,7 +405,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_ogg_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_ogg_open; diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c index 4b4e728b5..2fb0b9bcf 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.13 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_pes.c,v 1.14 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for mpeg 2 PES (Packetized Elementary Streams) * reads streams of variable blocksizes @@ -43,8 +43,6 @@ #define NUM_PREVIEW_BUFFERS 400 -static uint32_t xine_debug; - typedef struct demux_pes_s { demux_plugin_t demux_plugin; @@ -80,7 +78,6 @@ static uint32_t read_bytes (demux_pes_t *this, int n) { this->status = DEMUX_FINISHED; - xprintf (VERBOSE|DEMUX, "Unexpected end of stream\n"); } @@ -120,8 +117,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { int track; - xprintf (VERBOSE|DEMUX|AC3, ",ac3"); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -139,8 +134,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -150,8 +143,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { // track = this->dummy_space[0] & 0x0F ; track = 0; - xprintf (VERBOSE|DEMUX, ", track=%02x", track); - /* contents */ if(this->audio_fifo) @@ -181,8 +172,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { } else if ((nID & 0xe0) == 0xc0) { int track = nID & 0x1f; - xprintf (VERBOSE|DEMUX|AUDIO, ", audio #%d", track); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -200,8 +189,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -229,8 +216,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { } else if ((nID >= 0xbc) && ((nID & 0xf0) == 0xe0)) { - xprintf (VERBOSE|DEMUX|VIDEO, ",video"); - w = read_bytes(this, 1); flags = read_bytes(this, 1); header_len = read_bytes(this, 1); @@ -248,8 +233,6 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { w = read_bytes(this, 2); pts |= (w & 0xFFFE) >> 1; - xprintf (VERBOSE|DEMUX|VPTS, ", pts=%d",pts); - header_len -= 5 ; } @@ -277,14 +260,11 @@ static void parse_mpeg2_packet (demux_pes_t *this, int nID) { this->video_fifo->put (this->video_fifo, buf); } else { - xprintf (VERBOSE|DEMUX, ",unknown stream - skipped"); i = this->input->read (this->input, this->dummy_space, nLen); /* (*this->input->seek) (nLen,SEEK_CUR); */ } - xprintf (VERBOSE|DEMUX, ")\n"); - } @@ -301,8 +281,6 @@ static uint32_t parse_pack(demux_pes_t *this) buf = read_bytes (this, 3); - xprintf (VERBOSE|DEMUX, "}\n"); - return buf; } @@ -310,7 +288,6 @@ static uint32_t parse_pack(demux_pes_t *this) static void demux_pes_resync (demux_pes_t *this, uint32_t buf) { while ((buf !=0x000001) && (this->status == DEMUX_OK)) { - xprintf (VERBOSE|DEMUX, "resync : %08x\n",buf); buf = (buf << 8) | read_bytes (this, 1); } } @@ -343,8 +320,6 @@ static void *demux_pes_loop (void *this_gen) { } } - xprintf (VERBOSE|DEMUX, "demux loop finished (status: %d, buf:%x)\n", - this->status, w); printf ("demux loop finished (status: %d, buf:%x)\n", this->status, w); @@ -442,7 +417,6 @@ static void demux_pes_start (demux_plugin_t *this_gen, } while ( (this->status == DEMUX_OK) && (num_buffers>0)) ; - xprintf (VERBOSE|DEMUX, "=>seek to %Ld\n",start_pos); this->input->seek (this->input, start_pos+3, SEEK_SET); /* FIXME: implement time seek */ @@ -523,8 +497,6 @@ static int demux_pes_open(demux_plugin_t *this_gen, } ending = strrchr(MRL, '.'); - xprintf(VERBOSE|DEMUX, "demux_pes_can_handle: ending %s of %s\n", - ending, MRL); if(!ending) return DEMUX_CANNOT_HANDLE; @@ -578,7 +550,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_pes_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_pes_open; diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 9bb7990ac..723bba78c 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.13 2001/11/17 19:40:27 miguelfreitas Exp $ + * $Id: demux_qt.c,v 1.14 2001/11/18 03:53:23 guenter Exp $ * * demultiplexer for quicktime streams, based on: * @@ -54,8 +54,6 @@ #include "libw32dll/wine/vfw.h" #include "libw32dll/wine/mmreg.h" -static uint32_t xine_debug; - /* OpenQuicktime Codec Parameter Types */ #define QUICKTIME_UNKNOWN_PARAMETER -1 #define QUICKTIME_STRING_PARAMETER 0 @@ -4378,7 +4376,6 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { this = xine_xmalloc (sizeof (demux_qt_t)); config = xine->config; - xine_debug = config->lookup_int (config, "xine_debug", 0); this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_qt_open; diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 137b56969..add6bafd6 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.28 2001/11/17 14:26:37 f1rmb Exp $ + * $Id: demux_ts.c,v 1.29 2001/11/18 03:53:23 guenter Exp $ * * Demultiplexer for MPEG2 Transport Streams. * @@ -69,6 +69,10 @@ #include "demux.h" /* +#define TS_LOG +*/ + +/* * The maximum number of PIDs we are prepared to handle in a single program is the * number that fits in a single-packet PMT. */ @@ -147,8 +151,6 @@ typedef struct { unsigned int audioMedia; } demux_ts; -static uint32_t xine_debug; - static void demux_ts_build_crc32_table(demux_ts *this) { uint32_t i, j, k; @@ -230,6 +232,7 @@ static void demux_ts_parse_pat (demux_ts *this, unsigned char *original_pkt, crc32 |= (uint32_t)pkt[6+section_length] << 8; crc32 |= (uint32_t)pkt[7+section_length] ; +#ifdef TS_LOG xprintf (VERBOSE|DEMUX,"PAT table_id=%d\n", table_id); xprintf (VERBOSE|DEMUX,"\tsection_syntax=%d\n", @@ -246,6 +249,7 @@ static void demux_ts_parse_pat (demux_ts *this, unsigned char *original_pkt, section_number); xprintf (VERBOSE|DEMUX,"\tlast_section_number=%d\n", last_section_number); +#endif if (!(current_next_indicator)) { /* @@ -298,10 +302,12 @@ static void demux_ts_parse_pat (demux_ts *this, unsigned char *original_pkt, */ program_count = 0; while ((this->program_number[program_count] != INVALID_PROGRAM) ) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "PAT acquiring count=%d programNumber=0x%04x pmtPid=0x%04x\n", program_count, this->program_number[program_count], this->pmt_pid[program_count]); +#endif program_count++; } } @@ -330,9 +336,10 @@ static int demux_ts_parse_pes_header (demux_ts_media *m, uint8_t *buf, int packe if (packet_len==0) return 0; +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "packet stream id = %02x len = %d\n", stream_id, packet_len); - +#endif if (p[7] & 0x80) { /* PTS avail */ @@ -425,7 +432,9 @@ static int demux_ts_parse_pes_header (demux_ts_media *m, uint8_t *buf, int packe return 1; } else { +#ifdef TS_LOG xprintf(VERBOSE | DEMUX, "unknown packet, id = %x\n",stream_id); +#endif } return 0 ; @@ -608,6 +617,7 @@ static void demux_ts_parse_pmt(demux_ts *this, crc32 |= (uint32_t)pkt[6+section_length] << 8; crc32 |= (uint32_t)pkt[7+section_length] ; +#ifdef TS_LOG xprintf (VERBOSE|DEMUX,"PMT table_id=%d\n", table_id); xprintf (VERBOSE|DEMUX,"\tsection_syntax_indicator=%d\n", @@ -624,6 +634,7 @@ static void demux_ts_parse_pmt(demux_ts *this, section_number); xprintf (VERBOSE|DEMUX,"\tlast_section_number=%d\n", last_section_number); +#endif if (!(current_next_indicator)) { /* @@ -687,7 +698,9 @@ static void demux_ts_parse_pmt(demux_ts *this, case ISO_11172_VIDEO: case ISO_13818_VIDEO: if (this->videoPid == INVALID_PID) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "PMT video pid 0x%04x\n", pid); +#endif demux_ts_pes_new(this, mediaIndex, pid, this->fifoVideo); } this->videoPid = pid; @@ -696,36 +709,48 @@ static void demux_ts_parse_pmt(demux_ts *this, case ISO_11172_AUDIO: case ISO_13818_AUDIO: if (this->audioPid == INVALID_PID) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "PMT audio pid 0x%04x\n", pid); +#endif demux_ts_pes_new(this, mediaIndex, pid, this->fifoAudio); } this->audioPid = pid; this->audioMedia = mediaIndex; break; case ISO_13818_PRIVATE: +#ifdef TS_LOG for(i=0;i<20;i++) { xprintf(VERBOSE|DEMUX, "%02x ", stream[i]); } xprintf(VERBOSE|DEMUX, "\n"); +#endif break; case PRIVATE_A52: +#ifdef TS_LOG for(i=0;i<20;i++) { xprintf(VERBOSE|DEMUX, "%02x ", stream[i]); } xprintf(VERBOSE|DEMUX, "\n"); +#endif if (this->audioPid == INVALID_PID) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "PMT audio pid 0x%04x\n", pid); +#endif demux_ts_pes_new(this, mediaIndex, pid, this->fifoAudio); } this->audioPid = pid; this->audioMedia = mediaIndex; break; default: +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "PMT stream_type unknown 0x%02x pid 0x%04x\n", stream[0], pid); + for(i=0;i<20;i++) { xprintf(VERBOSE|DEMUX, "%02x ", stream[i]); } xprintf(VERBOSE|DEMUX, "\n"); + +#endif break; } mediaIndex++; @@ -739,11 +764,14 @@ static void demux_ts_parse_pmt(demux_ts *this, pid = (((unsigned int)pkt[13] & 0x1f) << 8) | pkt[14]; if (this->pcrPid != pid) { +#ifdef TS_LOG + if (this->pcrPid == INVALID_PID) { xprintf(VERBOSE|DEMUX, "PMT pcr pid 0x%04x\n", pid); } else { xprintf(VERBOSE|DEMUX, "PMT pcr pid changed 0x%04x\n", pid); } +#endif this->pcrPid = pid; } } @@ -818,6 +846,7 @@ static uint32_t demux_ts_adaptation_field_parse( uint8_t *data, uint32_t adaptat transport_private_data_flag = ((data[0] >> 1) & 0x01); adaptation_field_extension_flag = (data[0] & 0x01); +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "ADAPTATION FIELD length=%d\n", adaptation_field_length); if(discontinuity_indicator) { @@ -832,6 +861,7 @@ static uint32_t demux_ts_adaptation_field_parse( uint8_t *data, uint32_t adaptat xprintf(VERBOSE|DEMUX, "\tElementary_stream_priority_indicator=%d\n", elementary_stream_priority_indicator); } +#endif if(PCR_flag) { PCR = data[offset] << 25; PCR |= data[offset+1] << 17; @@ -839,8 +869,10 @@ static uint32_t demux_ts_adaptation_field_parse( uint8_t *data, uint32_t adaptat PCR |= data[offset+3] << 1; PCR |= (data[offset+4] >> 7) & 0x01; EPCR = ((data[offset+4] & 0x1) << 8) | data[offset+5]; +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "\tPCR=%u, EPCR=%u\n", PCR,EPCR); +#endif offset+=6; } if(OPCR_flag) { @@ -850,10 +882,13 @@ static uint32_t demux_ts_adaptation_field_parse( uint8_t *data, uint32_t adaptat OPCR |= data[offset+3] << 1; OPCR |= (data[offset+4] >> 7) & 0x01; EOPCR = ((data[offset+4] & 0x1) << 8) | data[offset+5]; +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "\tOPCR=%u,EOPCR=%u\n", OPCR,EOPCR); +#endif offset+=6; } +#ifdef TS_LOG if(slicing_point_flag) { xprintf(VERBOSE|DEMUX, "\tslicing_point_flag=%d\n", slicing_point_flag); @@ -866,6 +901,7 @@ static uint32_t demux_ts_adaptation_field_parse( uint8_t *data, uint32_t adaptat xprintf(VERBOSE|DEMUX, "\tadaptation_field_extension_flag=%d\n", adaptation_field_extension_flag); } +#endif return PCR; } /* transport stream packet layer */ @@ -939,12 +975,16 @@ static void demux_ts_parse_packet (demux_ts *this) { * Do the demuxing in descending order of packet frequency! */ if (pid == this->videoPid ) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "Video pid = 0x%04x\n",pid); +#endif demux_ts_buffer_pes (this, originalPkt+data_offset, this->videoMedia, payload_unit_start_indicator, continuity_counter, data_len); return; } else if (pid == this->audioPid) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "Audio pid = 0x%04x\n",pid); +#endif demux_ts_buffer_pes (this, originalPkt+data_offset, this->audioMedia, payload_unit_start_indicator, continuity_counter, data_len); return; @@ -952,16 +992,20 @@ static void demux_ts_parse_packet (demux_ts *this) { demux_ts_parse_pat (this, originalPkt, originalPkt+data_offset-4, payload_unit_start_indicator); return; } else if (pid == 0x1fff) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX,"Null Packet\n"); +#endif return; } if ((this->audioPid == INVALID_PID) && (this->videoPid == INVALID_PID)) { program_count = 0; while ((this->program_number[program_count] != INVALID_PROGRAM) ) { if ( pid == this->pmt_pid[program_count] ) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX,"PMT prog 0x%04x pid 0x%04x\n", this->program_number[program_count], this->pmt_pid[program_count]); +#endif demux_ts_parse_pmt (this, originalPkt, originalPkt+data_offset-4, payload_unit_start_indicator); return; } @@ -984,7 +1028,9 @@ static void *demux_ts_loop(void *gen_this) { demux_ts_parse_packet(this); } while (this->status == DEMUX_OK) ; +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "demux loop finished (status: %d)\n", this->status); +#endif this->status = DEMUX_FINISHED; buf = this->fifoVideo->buffer_pool_alloc(this->fifoVideo); @@ -1048,7 +1094,9 @@ static int demux_ts_open(demux_plugin_t *this_gen, input_plugin_t *input, } ending = strrchr(mrl, '.'); if (ending) { +#ifdef TS_LOG xprintf(VERBOSE|DEMUX, "demux_ts_open: ending %s of %s\n", ending, mrl); +#endif if ((!strcasecmp(ending, ".m2t")) || (!strcasecmp(ending, ".ts")) || (!strcasecmp(ending, ".trp")) ) { @@ -1176,7 +1224,7 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { */ this = xine_xmalloc(sizeof(*this)); config = xine->config; - xine_debug = config->lookup_int(config, "xine_debug", 0); + this->plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->plugin.open = demux_ts_open; this->plugin.start = demux_ts_start; |