diff options
Diffstat (limited to 'src/demuxers')
62 files changed, 819 insertions, 246 deletions
diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am index ac132463b..ba3041d5d 100644 --- a/src/demuxers/Makefile.am +++ b/src/demuxers/Makefile.am @@ -52,7 +52,8 @@ xineplug_LTLIBRARIES = \ xineplug_dmx_nsv.la \ xineplug_dmx_matroska.la \ xineplug_dmx_iff.la \ - xineplug_dmx_flv.la + xineplug_dmx_flv.la \ + xineplug_dmx_playlist.la xineplug_dmx_avi_la_SOURCES = demux_avi.c xineplug_dmx_avi_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) @@ -141,3 +142,6 @@ xineplug_dmx_iff_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) xineplug_dmx_flv_la_SOURCES = demux_flv.c xineplug_dmx_flv_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) + +xineplug_dmx_playlist_la_SOURCES = demux_playlist.c +xineplug_dmx_playlist_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) diff --git a/src/demuxers/asfheader.h b/src/demuxers/asfheader.h index 8126b129b..4bd13ab3f 100644 --- a/src/demuxers/asfheader.h +++ b/src/demuxers/asfheader.h @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
- * $Id: asfheader.h,v 1.8 2006/09/12 21:24:19 valtri Exp $
- *
* demultiplexer for asf streams
*
* based on ffmpeg's
diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h index abd72aadd..81907cfcf 100644 --- a/src/demuxers/demux.h +++ b/src/demuxers/demux.h @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * $Id: demux.h,v 1.40 2007/01/19 00:26:39 dgp85 Exp $ */ #ifndef HAVE_DEMUX_H diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index 4bdaa301a..24aee1ac4 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -22,8 +22,6 @@ * 4X Technologies (.4xm) File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information on the 4xm file format, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_4xm.c,v 1.16 2007/01/19 00:26:39 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c index ad663f052..d80413f83 100644 --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -20,8 +20,6 @@ * Raw AAC File Demuxer by Mike Melanson (melanson@pcisys.net) * This demuxer detects ADIF and ADTS headers in AAC files. * Then it shovels buffer-sized chunks over to the AAC decoder. - * - * $Id: demux_aac.c,v 1.17 2007/03/03 01:41:16 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c index 651a8af9d..c0fae275b 100644 --- a/src/demuxers/demux_ac3.c +++ b/src/demuxers/demux_ac3.c @@ -22,8 +22,6 @@ * AC3 File Demuxer by Mike Melanson (melanson@pcisys.net) * This demuxer detects raw AC3 data in a file and shovels AC3 data * directly to the AC3 decoder. - * - * $Id: demux_ac3.c,v 1.21 2007/03/19 16:42:32 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 40c8e7457..7fcaea70e 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -20,9 +20,6 @@ /* * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) - * - * $Id: demux_aiff.c,v 1.41 2007/01/19 00:26:40 dgp85 Exp $ - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 4b6672cb0..742fa6541 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_asf.c,v 1.194 2007/03/09 23:18:19 dgp85 Exp $ - * * demultiplexer for asf streams * * based on ffmpeg's @@ -1538,108 +1536,90 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) { ENTRYREF, MOREINFO, PARAM, REPEAT, TITLE */ - const char *version = xml_parser_get_property (xml_tree, "VERSION"); + const char *base_href = NULL; - if (version) { - int version_major, version_minor = 0; + for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next) + { + const char *ref_base_href = base_href; - if((sscanf (version, "%d.%d", &version_major, &version_minor) == 2 || - sscanf (version, "%d", &version_major) == 1) && - (version_major == 3 && version_minor == 0)) + if (!strcasecmp (asx_entry->name, "ENTRY")) { - const char *base_href = NULL; + /* Attributes: CLIENTSKIP, SKIPIFREF + * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION, + ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER, + STARTTIME, TITLE + */ + const char *href = NULL; + const char *title = NULL; + uint32_t start_time = (uint32_t)-1; + uint32_t duration = (uint32_t)-1; - for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next) + for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next) { - const char *ref_base_href = base_href; - - if (!strcasecmp (asx_entry->name, "ENTRY")) + if (!strcasecmp(asx_ref->name, "REF")) { - /* Attributes: CLIENTSKIP, SKIPIFREF - * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION, - ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER, - STARTTIME, TITLE + xml_node_t *asx_sub; + /* Attributes: HREF + * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME + */ + + /* FIXME: multiple REFs => alternative streams + * (and per-ref start times and durations?). + * Just the one title, though. */ - const char *href = NULL; - const char *title = NULL; - uint32_t start_time = (uint32_t)-1; - uint32_t duration = (uint32_t)-1; + href = xml_parser_get_property (asx_ref, "HREF"); - for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next) + for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next) { - if (!strcasecmp(asx_ref->name, "REF")) - { - xml_node_t *asx_sub; - /* Attributes: HREF - * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME - */ - - /* FIXME: multiple REFs => alternative streams - * (and per-ref start times and durations?). - * Just the one title, though. - */ - href = xml_parser_get_property (asx_ref, "HREF"); - - for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next) - { - if (!strcasecmp (asx_sub->name, "STARTTIME")) - start_time = asx_get_time_value (asx_sub); - else if (!strcasecmp (asx_sub->name, "DURATION")) - duration = asx_get_time_value (asx_sub); - } - } - - else if (!strcasecmp (asx_ref->name, "TITLE")) - { - if (!title) - title = asx_ref->data; - } - - else if (!strcasecmp (asx_ref->name, "STARTTIME")) - { - if (start_time == (uint32_t)-1) - start_time = asx_get_time_value (asx_ref); - } - - else if (!strcasecmp (asx_ref->name, "DURATION")) - { - if (duration == (uint32_t)-1) - duration = asx_get_time_value (asx_ref); - } - - else if (!strcasecmp (asx_ref->name, "BASE")) - /* Attributes: HREF */ - ref_base_href = xml_parser_get_property (asx_entry, "HREF"); + if (!strcasecmp (asx_sub->name, "STARTTIME")) + start_time = asx_get_time_value (asx_sub); + else if (!strcasecmp (asx_sub->name, "DURATION")) + duration = asx_get_time_value (asx_sub); } + } - /* FIXME: prepend ref_base_href to href */ - if (href && *href) - _x_demux_send_mrl_reference (this->stream, 0, href, title, - start_time == (uint32_t)-1 ? 0 : start_time, - duration == (uint32_t)-1 ? -1 : duration); + else if (!strcasecmp (asx_ref->name, "TITLE")) + { + if (!title) + title = asx_ref->data; } - else if (!strcasecmp (asx_entry->name, "ENTRYREF")) + else if (!strcasecmp (asx_ref->name, "STARTTIME")) { - /* Attributes: HREF, CLIENTBIND */ - const char *href = xml_parser_get_property (asx_entry, "HREF"); - if (href && *href) - _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1); + if (start_time == (uint32_t)-1) + start_time = asx_get_time_value (asx_ref); } - else if (!strcasecmp (asx_entry->name, "BASE")) + else if (!strcasecmp (asx_ref->name, "DURATION")) + { + if (duration == (uint32_t)-1) + duration = asx_get_time_value (asx_ref); + } + + else if (!strcasecmp (asx_ref->name, "BASE")) /* Attributes: HREF */ - base_href = xml_parser_get_property (asx_entry, "HREF"); + ref_base_href = xml_parser_get_property (asx_entry, "HREF"); } + + /* FIXME: prepend ref_base_href to href */ + if (href && *href) + _x_demux_send_mrl_reference (this->stream, 0, href, title, + start_time == (uint32_t)-1 ? 0 : start_time, + duration == (uint32_t)-1 ? -1 : duration); } - else - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - _("demux_asf: Wrong ASX version: %s\n"), version); - + + else if (!strcasecmp (asx_entry->name, "ENTRYREF")) + { + /* Attributes: HREF, CLIENTBIND */ + const char *href = xml_parser_get_property (asx_entry, "HREF"); + if (href && *href) + _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1); + } + + else if (!strcasecmp (asx_entry->name, "BASE")) + /* Attributes: HREF */ + base_href = xml_parser_get_property (asx_entry, "HREF"); } - else - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "demux_asf: Unable to find VERSION tag from ASX.\n"); } else xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c index 89ca8f061..6223a4068 100644 --- a/src/demuxers/demux_aud.c +++ b/src/demuxers/demux_aud.c @@ -33,8 +33,6 @@ * initialized to 0 at the start of the file and maintained throughout the * data. This makes seeking conceptually impossible. Upshot: Random * seeking is not supported. - * - * $Id: demux_aud.c,v 1.20 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 614c84091..544c19d76 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_avi.c,v 1.232 2007/03/29 19:24:18 dgp85 Exp $ - * * demultiplexer for avi streams * * part of the code is taken from @@ -46,7 +44,6 @@ * expect to find the next A/V frame. We periodically check if we can * read data from the file at that offset. If we can, we append index * data for as many frames as we can read at the time. - * */ /* @@ -55,7 +52,6 @@ * Transcode's and xine's avi code comes from the same source and * still has a very similar architecture, so it wasn't much effort to * port it from transcode to xine. - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index b52e23ac5..0f34a7cec 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -23,8 +23,6 @@ * All this demuxer does is read raw CD frames and shovel them to the * linear PCM "decoder" (which in turn sends them directly to the audio * output target; this is a really fancy CD-playing architecture). - * - * $Id: demux_cdda.c,v 1.20 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c index 078c84ea1..7c9b47fcd 100644 --- a/src/demuxers/demux_dts.c +++ b/src/demuxers/demux_dts.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * Raw DTS Demuxer by James Stembridge (jstembridge@gmail.com) - * - * $Id: demux_dts.c,v 1.8 2007/03/19 16:42:32 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index 4076fbadc..2359d3baf 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_eawve.c,v 1.29 2007/01/19 00:26:40 dgp85 Exp $ - * * demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format * * written and currently maintained by Robin Kay <komadori@myrealbox.com> diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index c0f34240a..d0a821504 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_elem.c,v 1.91 2007/02/20 00:34:55 dgp85 Exp $ - * * demultiplexer for elementary mpeg streams */ diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 6a639ae22..26a7a9713 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -20,8 +20,6 @@ * FILM (CPK) File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_film.c,v 1.82 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index 502c8772c..9bf78ff38 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -22,8 +22,6 @@ * FLAC File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information on the FLAC file format, visit: * http://flac.sourceforge.net/ - * - * $Id: demux_flac.c,v 1.17 2007/03/29 16:52:23 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 2a68bcfc8..99843a68c 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -23,8 +23,6 @@ * For information on the FLI format, as well as various traps to * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_fli.c,v 1.60 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index 940d651e2..aa9fae13c 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -25,8 +25,6 @@ * * For more information on the FLV file format, visit: * http://download.macromedia.com/pub/flash/flash_file_format_specification.pdf - * - * $Id: demux_flv.c,v 1.21 2007/03/17 11:29:43 klan Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 8c520150c..11cb8cb9e 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -64,8 +64,6 @@ * - scan through all 768 palette bytes * - 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.55 2007/02/20 00:34:55 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index cc3a68507..d914405db 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -35,8 +35,6 @@ * - simple pictures work, nothing more (most work is done in bitmap-decoder) * * ANIM (Animations) * - Animation works fine, without seeking. - * - * $Id: demux_iff.c,v 1.19 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c index 6c05ed301..9f53e4173 100644 --- a/src/demuxers/demux_image.c +++ b/src/demuxers/demux_image.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_image.c,v 1.26 2007/01/19 00:26:40 dgp85 Exp $ - * * image dummy demultiplexer */ diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c index 9d284ff66..cd21896c0 100644 --- a/src/demuxers/demux_ipmovie.c +++ b/src/demuxers/demux_ipmovie.c @@ -22,8 +22,6 @@ * Interplay MVE File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information regarding the Interplay MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_ipmovie.c,v 1.27 2007/02/20 00:34:55 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 9609a75e5..0169651a0 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -17,15 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_matroska.c,v 1.53 2007/03/12 16:27:21 dgp85 Exp $ - * * demultiplexer for matroska streams * * TODO: * more decoders init * metadata * non seekable input plugins support - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c index 373cedf80..12da8ca86 100644 --- a/src/demuxers/demux_mng.c +++ b/src/demuxers/demux_mng.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_mng.c,v 1.29 2007/01/19 00:26:40 dgp85 Exp $ - * * demux_mng.c, Demuxer plugin for Multiple-image Network Graphics format * * written and currently maintained by Robin Kay <komadori@myrealbox.com> diff --git a/src/demuxers/demux_mpc.c b/src/demuxers/demux_mpc.c index 2718da54c..346f0c2e6 100644 --- a/src/demuxers/demux_mpc.c +++ b/src/demuxers/demux_mpc.c @@ -23,8 +23,6 @@ * ID3 tag reading * APE tag reading * Seeking?? - * - * $Id: demux_mpc.c,v 1.5 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index dfe9b7798..4419f8404 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_mpeg.c,v 1.152 2007/02/20 00:34:55 dgp85 Exp $ - * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes */ diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index e9023b7c5..32638129d 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -17,11 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_mpeg_block.c,v 1.220 2007/02/20 00:34:55 dgp85 Exp $ - * * demultiplexer for mpeg 1/2 program streams * used with fixed blocksize devices (like dvd/vcd) - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c index 0cab7e671..423da5e24 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -17,15 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_mpeg_pes.c,v 1.43 2007/03/29 17:11:36 dgp85 Exp $ - * * demultiplexer for mpeg 2 PES (Packetized Elementary Streams) * reads streams of variable blocksizes * * 1-7-2003 New implementation of mpeg 2 PES demuxers. * (c) 2003 James Courtier-Dutton James@superbug.demon.co.uk * This code might also decode normal MPG files. - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index a45cb6367..9c997c9f5 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_mpgaudio.c,v 1.156 2007/03/29 16:32:12 dgp85 Exp $ - * * demultiplexer for mpeg audio (i.e. mp3) streams * * mp3 file structure: * [id3v2][Xing|Vbri] Frame1 Frame2 Frame3...FrameX [Lyrics][id3v2][id3v1] - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index 4abaf4058..44bb18c79 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -22,8 +22,6 @@ * Nullsoft Video (NSV) file demuxer by Mike Melanson (melanson@pcisys.net) * For more information regarding the NSV file format, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_nsv.c,v 1.25 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_playlist.c b/src/demuxers/demux_playlist.c new file mode 100644 index 000000000..bbe6998e6 --- /dev/null +++ b/src/demuxers/demux_playlist.c @@ -0,0 +1,746 @@ +/* + * Copyright (C) 2007 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * + * Playlist parser/demuxer by + * Claudio Ciccani (klan@users.sourceforge.net) + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <fcntl.h> +#include <unistd.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> + +#define LOG_MODULE "demux_playlist" +#define LOG_VERBOSE +/* +#define LOG +*/ + +#include "xine_internal.h" +#include "xineutils.h" +#include "bswap.h" +#include "demux.h" + +typedef enum { + XINE_PLT_NONE = 0, + XINE_PLT_REF = ME_FOURCC('R','E','F',0), + XINE_PLT_M3U = ME_FOURCC('M','3','U',0), + XINE_PLT_RAM = ME_FOURCC('R','A','M',0), + XINE_PLT_PLS = ME_FOURCC('P','L','S',0), + XINE_PLT_ASX = ME_FOURCC('A','S','X',0), + XINE_PLT_SMI = ME_FOURCC('S','M','I',0), + XINE_PLT_QTL = ME_FOURCC('Q','T','L',0), + XINE_PLT_XSPF = ME_FOURCC('X','S','P',0), + XINE_PLT_RSS = ME_FOURCC('R','S','S',0) +} playlist_t; + +typedef struct { + demux_plugin_t demux_plugin; + + xine_t *xine; + xine_stream_t *stream; + input_plugin_t *input; + + playlist_t playlist; + + int status; +} demux_playlist_t; + +typedef struct { + demux_class_t demux_class; +} demux_playlist_class_t; + + +static playlist_t detect_by_extension (input_plugin_t *input) { + char *ext; + + ext = strrchr (input->get_mrl (input), '.'); + if (!ext) + return XINE_PLT_NONE; + + if (!strcasecmp (ext, ".m3u")) + return XINE_PLT_M3U; + if (!strcasecmp (ext, ".ram")) + return XINE_PLT_RAM; + if (!strcasecmp (ext, ".pls")) + return XINE_PLT_PLS; + if (!strcasecmp (ext, ".wax") || + !strcasecmp (ext, ".wvx") || + !strcasecmp (ext, ".asx")) + return XINE_PLT_ASX; + if (!strcasecmp (ext, ".smi") || + !strcasecmp (ext, ".smil")) + return XINE_PLT_SMI; + if (!strcasecmp (ext, ".qtl")) + return XINE_PLT_QTL; + if (!strcasecmp (ext, ".xspf")) + return XINE_PLT_XSPF; + if (!strcasecmp (ext, ".rss")) + return XINE_PLT_RSS; + + return XINE_PLT_NONE; +} + +static playlist_t detect_by_content (input_plugin_t *input) { + char buf[256], *tmp; + int len; + + len = _x_demux_read_header (input, buf, sizeof(buf)-1); + if (len <= 0) + return XINE_PLT_NONE; + buf[len] = '\0'; + + tmp = buf; + while (*tmp && isspace(*tmp)) + tmp++; + + if (!strncmp (tmp, "[Reference]", 11) || + !strncmp (tmp, "Ref1=", 5)) + return XINE_PLT_REF; + if (!strncmp (tmp, "#EXTM3U", 7)) + return XINE_PLT_M3U; + if (!strncmp (tmp, "file://", 7) || + !strncmp (tmp, "http://", 7) || + !strncmp (tmp, "rtsp://", 7) || + !strncmp (tmp, "pnm://", 6)) + return XINE_PLT_RAM; + if (!strncmp (tmp, "[Playlist]", 10 )) + return XINE_PLT_PLS; + if (!strncasecmp (tmp, "<ASX", 4)) + return XINE_PLT_ASX; + if (!strncmp (tmp, "<smil", 5)) + return XINE_PLT_SMI; + if (!strncmp (tmp, "<?quicktime", 11)) + return XINE_PLT_QTL; + if (!strncmp (tmp, "<playlist", 9)) + return XINE_PLT_XSPF; + if (!strncmp (tmp, "<rss", 4)) + return XINE_PLT_RSS; + + if (!strncmp (tmp, "<?xml", 5)) { + tmp += 5; + while ((tmp = strchr (tmp, '<'))) { + if (!strncasecmp (tmp, "<ASX", 4)) + return XINE_PLT_ASX; + if (!strncmp (tmp, "<smil", 5)) + return XINE_PLT_SMI; + if (!strncmp (tmp, "<?quicktime", 11)) + return XINE_PLT_QTL; + if (!strncmp (tmp, "<playlist", 9)) + return XINE_PLT_XSPF; + if (!strncmp (tmp, "<rss", 4)) + return XINE_PLT_RSS; + tmp++; + } + } + + return XINE_PLT_NONE; +} + +static char* trim (char *s) { + char *e; + + while (*s && isspace(*s)) + s++; + + e = s + strlen(s) - 1; + while (e > s && isspace(*e)) + *e-- = '\0'; + + return s; +} + +static int parse_time (const char *s) { + int t = 0; + int i; + + if (!s) + return 0; + + if (!strncmp (s, "npt=", 4)) + s += 4; + else if (!strncmp (s, "smpte=", 6)) + s += 6; + + for (i = 0; i < 3; i++) { + t *= 60; + t += atoi(s); + s = strchr (s, ':'); + if (!s) + break; + s++; + } + + return t*1000; +} + +static void parse_ref (demux_playlist_t *this, char *data, int length) { + char *src = data; + char *end; + int alt = 0; + + while (src && *src) { + end = strchr (src, '\n'); + if (end) + *end = '\0'; + + src = trim (src); + if (!strncmp (src, "Ref", 3)) { + src = strchr (src, '='); + if (src && *(src+1)) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, alt++, src+1, NULL, 0, 0); + } + } + + src = end; + if (src) + src++; + } +} + +static void parse_m3u (demux_playlist_t *this, char *data, int length) { + char *src = data; + char *end; + char *title = NULL; + + while (src && *src) { + end = strchr (src, '\n'); + if (end) + *end = '\0'; + + src = trim (src); + if (*src == '#') { + if (!strncmp (src+1, "EXTINF:", 7)) { + title = strchr (src+8, ','); + if (title) + title++; + } + } + else if (*src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0); + } + + src = end; + if (src) + src++; + } +} + +static void parse_ram (demux_playlist_t *this, char *data, int length) { + char *src = data; + char *end; + + while (src && *src) { + end = strchr (src, '\n'); + if (end) + *end = '\0'; + + src = trim (src); + if (!strcmp (src, "--stop--")) + break; + + if (*src && *src != '#') { + char *title = NULL; + + if (!strncmp (src, "rtsp://", 7) || !strncmp (src, "pnm://", 7)) { + char *tmp = strrchr (src, '?'); + if (tmp) { + *tmp = '\0'; + title = strstr (tmp+1, "title="); + if (title) { + title += 6; + tmp = strchr (title, '&'); + if (tmp) + *tmp = '\0'; + } + } + } + + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0); + } + + src = end; + if (src) + src++; + } +} + +static void parse_pls (demux_playlist_t *this, char *data, int length) { + char *src = data; + char *end; + + while (src && *src) { + end = strchr (src, '\n'); + if (end) + *end = '\0'; + + src = trim (src); + if (!strncmp (src, "File", 4)) { + src = strchr (src+4, '='); + if (src && *(src+1)) { + lprintf ("mrl:'%s'\n", src+1); + _x_demux_send_mrl_reference (this->stream, 0, src+1, NULL, 0, 0); + } + } + + src = end; + if (src) + src++; + } +} + +static void parse_asx (demux_playlist_t *this, char *data, int length) { + xml_node_t *root, *node, *tmp; + int is_asx = 0; + + xml_parser_init (data, length, XML_PARSER_CASE_INSENSITIVE); + + if (xml_parser_build_tree (&root) >= 0) { + if (!strcasecmp (root->name, "asx")) { + is_asx = 1; + + for (node = root->child; node; node = node->next) { + if (!strcasecmp (node->name, "entry")) { + const char *title = NULL; + const char *src = NULL; + const char *start = NULL; + const char *duration = NULL; + + for (tmp = node->child; tmp; tmp = tmp->next) { + if (!strcasecmp (tmp->name, "title")) { + title = tmp->data; + } + else if (!strcasecmp (tmp->name, "ref")) { + src = xml_parser_get_property (tmp, "href"); + } + else if (!strcasecmp (tmp->name, "starttime")) { + start = xml_parser_get_property (tmp, "value"); + } + else if (!strcasecmp (tmp->name, "duration")) { + duration = xml_parser_get_property (tmp, "value"); + } + } + + if (src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, + parse_time(start), parse_time(duration)); + } + } + } + } + + xml_parser_free_tree (root); + } + + if (!is_asx) { + /* No tags found? Might be a references list. */ + parse_ref (this, data, length); + } +} + +static void parse_smi (demux_playlist_t *this, char *data, int length) { + xml_node_t *root, *node, *tmp; + int is_smi = 0; + + xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE); + + if (xml_parser_build_tree (&root) >= 0) { + for (node = root; node; node = node->next) { + if (!strcmp (node->name, "smil")) + break; + } + + if (node) { + is_smi = 1; + + for (node = node->child; node; node = node->next) { + if (!strcmp (node->name, "body")) { + for (tmp = node->child; tmp; tmp = tmp->next) { + if (!strcmp (tmp->name, "audio") || !strcmp (tmp->name, "video")) { + const char *src, *title; + int start, end; + + src = xml_parser_get_property (tmp, "src"); + title = xml_parser_get_property (tmp, "title"); + start = parse_time (xml_parser_get_property (tmp, "clipBegin") ? : + xml_parser_get_property (tmp, "clip-begin")); + end = parse_time (xml_parser_get_property (tmp, "clipEnd") ? : + xml_parser_get_property (tmp, "clip-end")); + + if (src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, + start, end ? (end-start) : 0); + } + } + } + } + } + } + + xml_parser_free_tree (root); + } + + if (!is_smi) { + /* No tags found? Might be a RAM playlist. */ + parse_ram (this, data, length); + } +} + +static void parse_qtl (demux_playlist_t *this, char *data, int length) { + xml_node_t *root, *node; + + xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE); + + if (xml_parser_build_tree (&root) >= 0) { + for (node = root; node; node = node->next) { + if (!strcmp (node->name, "embed")) { + const char *src; + + src = xml_parser_get_property (node, "src"); + if (src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, NULL, 0, 0); + } + } + } + + xml_parser_free_tree (root); + } +} + +static void parse_xspf (demux_playlist_t *this, char *data, int length) { + xml_node_t *root, *node, *tmp; + + xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE); + + if (xml_parser_build_tree (&root) >= 0) { + for (node = root; node; node = node->next) { + if (!strcmp (node->name, "playlist")) + break; + } + if (node) { + for (node = node->child; node; node = node->next) { + if (!strcmp (node->name, "trackList")) + break; + } + } + if (node) { + for (node = node->child; node; node = node->next) { + if (!strcmp (node->name, "track")) { + char *src = NULL; + char *title = NULL; + + for (tmp = node->child; tmp; tmp = tmp->next) { + if (!strcmp (tmp->name, "location")) { + src = trim((char*)tmp->data); + } + else if (!strcmp (tmp->name, "title")) { + title = trim((char*)tmp->data); + } + } + + if (src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0); + } + } + } + } + + xml_parser_free_tree (root); + } +} + +static void parse_rss (demux_playlist_t *this, char *data, int length) { + xml_node_t *root, *node, *item, *tmp; + + xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE); + + if (xml_parser_build_tree (&root) >= 0) { + for (node = root; node; node = node->next) { + if (!strcmp (node->name, "rss")) + break; + } + + if (node) { + for (node = node->child; node; node = node->next) { + if (strcmp (node->name, "channel")) + continue; + + for (item = node->child; item; item = item->next) { + if (!strcmp (item->name, "item")) { + const char *title = NULL; + const char *src = NULL; + + for (tmp = item->child; tmp; tmp = tmp->next) { + if (!strcmp (tmp->name, "title")) { + title = tmp->data; + } + else if (!strcmp (tmp->name, "enclosure")) { + src = xml_parser_get_property (tmp, "url"); + } + } + + if (src) { + lprintf ("mrl:'%s'\n", src); + _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0); + } + } + } + } + } + + xml_parser_free_tree (root); + } +} + + +static void demux_playlist_send_headers (demux_plugin_t *this_gen) { + demux_playlist_t *this = (demux_playlist_t *) this_gen; + + this->status = DEMUX_OK; + + _x_demux_control_start (this->stream); + + this->input->seek (this->input, 0, SEEK_SET); +} + + +static int demux_playlist_send_chunk (demux_plugin_t *this_gen) { + demux_playlist_t *this = (demux_playlist_t *) this_gen; + char *data = NULL; + int length; + + length = this->input->get_length (this->input); + if (length > 0) { + data = xine_xmalloc (length+1); + if (data) + this->input->read (this->input, data, length); + } + else { + char buf[1024]; + int len; + + length = 0; + while ((len = this->input->read (this->input, buf, sizeof(buf))) > 0) { + data = realloc (data, length+len+1); + if (!data) + break; + + memcpy (data+length, buf, len); + length += len; + data[length] = '\0'; + } + } + + lprintf ("data:%p length:%d\n", data, length); + + if (data) { + switch (this->playlist) { + case XINE_PLT_REF: + parse_ref (this, data, length); + break; + case XINE_PLT_M3U: + parse_m3u (this, data, length); + break; + case XINE_PLT_RAM: + parse_ram (this, data, length); + break; + case XINE_PLT_PLS: + parse_pls (this, data, length); + break; + case XINE_PLT_ASX: + parse_asx (this, data, length); + break; + case XINE_PLT_SMI: + parse_smi (this, data, length); + break; + case XINE_PLT_QTL: + parse_qtl (this, data, length); + break; + case XINE_PLT_XSPF: + parse_xspf (this, data, length); + break; + case XINE_PLT_RSS: + parse_rss (this, data, length); + break; + default: + lprintf ("unexpected playlist type 0x%08x\n", this->playlist); + break; + } + + free (data); + } + + this->status = DEMUX_FINISHED; + + return DEMUX_FINISHED; +} + +static int demux_playlist_seek (demux_plugin_t *this_gen, + off_t start_pos, int start_time, int playing) { + return DEMUX_OK; +} + +static void demux_playlist_dispose (demux_plugin_t *this_gen) { + demux_playlist_t *this = (demux_playlist_t *) this_gen; + + free (this); +} + +static int demux_playlist_get_status (demux_plugin_t *this_gen) { + demux_playlist_t *this = (demux_playlist_t *) this_gen; + + return this->status; +} + +static int demux_playlist_get_stream_length (demux_plugin_t *this_gen) { + return 0; +} + +static uint32_t demux_playlist_get_capabilities (demux_plugin_t *this_gen) { + return DEMUX_CAP_NOCAP; +} + +static int demux_playlist_get_optional_data (demux_plugin_t *this_gen, + void *data, int data_type) { + return DEMUX_OPTIONAL_UNSUPPORTED; +} + + +static demux_plugin_t *open_plugin (demux_class_t *class_gen, + xine_stream_t *stream, input_plugin_t *input) { + demux_playlist_t *this; + + this = xine_xmalloc (sizeof (demux_playlist_t)); + this->xine = stream->xine; + this->stream = stream; + this->input = input; + + this->demux_plugin.send_headers = demux_playlist_send_headers; + this->demux_plugin.send_chunk = demux_playlist_send_chunk; + this->demux_plugin.seek = demux_playlist_seek; + this->demux_plugin.dispose = demux_playlist_dispose; + this->demux_plugin.get_status = demux_playlist_get_status; + this->demux_plugin.get_stream_length = demux_playlist_get_stream_length; + this->demux_plugin.get_capabilities = demux_playlist_get_capabilities; + this->demux_plugin.get_optional_data = demux_playlist_get_optional_data; + this->demux_plugin.demux_class = class_gen; + + switch (stream->content_detection_method) { + case METHOD_BY_EXTENSION: + lprintf ("detect by extension\n"); + this->playlist = detect_by_extension (input); + if (!this->playlist) { + free (this); + return NULL; + } + break; + + case METHOD_BY_CONTENT: + case METHOD_EXPLICIT: + lprintf ("detect by content\n"); + this->playlist = detect_by_content (input); + if (!this->playlist) { + free (this); + return NULL; + } + break; + + default: + free (this); + return NULL; + } + + lprintf ("playlist:0x%08x (%s)\n", this->playlist, (char*)&this->playlist); + + return &this->demux_plugin; +} + +static const char *get_description (demux_class_t *this_gen) { + return "Playlist demux plugin"; +} + +static const char *get_identifier (demux_class_t *this_gen) { + return "playlist"; +} + +static const char *get_extensions (demux_class_t *this_gen) { + return "m3u ram pls asx wax wvx smi smil qtl xspf rss"; +} + +static const char *get_mimetypes (demux_class_t *this_gen) { + return "audio/mpegurl: m3u: M3U playlist;" + "audio/x-mpegurl: m3u: M3U playlist;" + //"audio/x-pn-realaudio: ram: RAM playlist;" + //"audio/vnd.rn-realaudio: ram: RAM playlist;" + "audio/x-scpls: pls: Winamp playlist;" + "audio/x-ms-wax: wax, asx: WAX playlist;" + "audio/x-ms-wvx: wvx, asx: WVX playlist;" + "application/smil: smi, smil: SMIL playlist;" + "application/x-quicktimeplayer: qtl: Quicktime playlist;" + "application/xspf+xml: xspf: XSPF playlist;"; +} + +static void class_dispose (demux_class_t *this_gen) { + demux_playlist_class_t *this = (demux_playlist_class_t *) this_gen; + + free (this); +} + +static void *init_plugin (xine_t *xine, void *data) { + demux_playlist_class_t *this; + + this = xine_xmalloc (sizeof(demux_playlist_class_t)); + + this->demux_class.open_plugin = open_plugin; + this->demux_class.get_description = get_description; + this->demux_class.get_identifier = get_identifier; + this->demux_class.get_mimetypes = get_mimetypes; + this->demux_class.get_extensions = get_extensions; + this->demux_class.dispose = class_dispose; + + return this; +} + +/* + * exported plugin catalog entry + */ +static const demuxer_info_t demux_info_flv = { + 10 /* priority */ +}; + +const plugin_info_t xine_plugin_info[] EXPORTED = { + /* type, API, "name", version, special_info, init_function */ + { PLUGIN_DEMUX, 26, "playlist", XINE_VERSION_CODE, &demux_info_flv, init_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } +}; diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c index d15aa605f..298d936b5 100644 --- a/src/demuxers/demux_pva.c +++ b/src/demuxers/demux_pva.c @@ -22,8 +22,6 @@ * TechnoTrend PVA File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information regarding the PVA file format, refer to this PDF: * http://www.technotrend.de/download/av_format_v1.pdf - * - * $Id: demux_pva.c,v 1.25 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index ec3fb6f74..89d0283ac 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -29,9 +29,6 @@ * parse_trak_atom * build_frame_table * free_qt_info - * - * $Id: demux_qt.c,v 1.214 2007/01/19 01:05:24 dgp85 Exp $ - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c index 130f15daa..2d21f080d 100644 --- a/src/demuxers/demux_rawdv.c +++ b/src/demuxers/demux_rawdv.c @@ -19,8 +19,6 @@ */ /* - * $Id: demux_rawdv.c,v 1.30 2007/01/19 00:26:40 dgp85 Exp $ - * * demultiplexer for raw dv streams */ diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 957d5cc4e..60fa91451 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -30,8 +30,6 @@ * (C) Alex Beregszaszi <alex@naxine.org> * * Based on FFmpeg's libav/rm.c. - * - * $Id: demux_real.c,v 1.113 2007/02/20 00:34:56 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 70329d2c6..1e7c3c7de 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -21,8 +21,6 @@ /* * RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net) * improved by James Stembridge (jstembridge@users.sourceforge.net) - * - * $Id: demux_realaudio.c,v 1.34 2007/03/29 17:00:32 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index 77e3b6ce2..18edaea87 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -22,8 +22,6 @@ * RoQ File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ - * - * $Id: demux_roq.c,v 1.54 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_shn.c b/src/demuxers/demux_shn.c index a1a88e18d..87324ab45 100644 --- a/src/demuxers/demux_shn.c +++ b/src/demuxers/demux_shn.c @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * $Id: demux_shn.c,v 1.4 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c index e394cf447..436d37579 100644 --- a/src/demuxers/demux_slave.c +++ b/src/demuxers/demux_slave.c @@ -21,8 +21,6 @@ */ /* - * $Id: demux_slave.c,v 1.23 2007/01/19 01:05:24 dgp85 Exp $ - * * demuxer for slave "protocol" * master xine must be started with XINE_PARAM_BROADCASTER_PORT set, that is, * 'xine --broadcast-port <port_number>' diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index d387341a8..899fbf7e3 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -22,8 +22,6 @@ * SMJPEG File Demuxer by Mike Melanson (melanson@pcisys.net) * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 - * - * $Id: demux_smjpeg.c,v 1.51 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 16fd35201..0965a75ae 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -20,8 +20,6 @@ /* * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) - * - * $Id: demux_snd.c,v 1.41 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 5d4047ce0..2cf542014 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -23,8 +23,6 @@ * and Stuart Caie (kyzer@4u.net) * 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.26 2007/01/19 00:26:40 dgp85 Exp $ */ /* diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index d7fd24773..19826bf71 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * - * $Id: demux_ts.c,v 1.129 2007/04/02 10:46:08 dgp85 Exp $ - * * Demultiplexer for MPEG2 Transport Streams. * * For the purposes of playing video, we make some assumptions about the @@ -298,7 +296,6 @@ typedef struct { uint32_t pmt_pid[MAX_PMTS]; uint8_t *pmt[MAX_PMTS]; uint8_t *pmt_write_ptr[MAX_PMTS]; - uint32_t crc32_table[256]; uint32_t last_pmt_crc; /* * Stuff to do with the transport header. As well as the video @@ -358,28 +355,6 @@ typedef struct { } demux_ts_class_t; -static void demux_ts_build_crc32_table(demux_ts_t*this) { - uint32_t i, j, k; - - for( i = 0 ; i < 256 ; i++ ) { - k = 0; - for (j = (i << 24) | 0x800000 ; j != 0x80000000 ; j <<= 1) { - k = (k << 1) ^ (((k ^ j) & 0x80000000) ? 0x04c11db7 : 0); - } - this->crc32_table[i] = k; - } -} - -static uint32_t demux_ts_compute_crc32(demux_ts_t*this, uint8_t *data, - uint32_t length, uint32_t crc32) { - uint32_t i; - - for(i = 0; i < length; i++) { - crc32 = (crc32 << 8) ^ this->crc32_table[(crc32 >> 24) ^ data[i]]; - } - return crc32; -} - /* redefine abs as macro to handle 64-bit diffs. i guess llabs may not be available everywhere */ #define abs(x) ( ((x)<0) ? -(x) : (x) ) @@ -523,7 +498,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt, unsigned char *pkt, unsigned int pusi) { uint32_t table_id; uint32_t section_syntax_indicator; - uint32_t section_length; + int32_t section_length; uint32_t transport_stream_id; uint32_t version_number; uint32_t current_next_indicator; @@ -598,8 +573,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt, } /* Check CRC. */ - calc_crc32 = demux_ts_compute_crc32 (this, pkt+5, section_length+3-4, - 0xffffffff); + calc_crc32 = _x_compute_crc32 (pkt+5, section_length+3-4, 0xffffffff); if (crc32 != calc_crc32) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: demux error! PAT with invalid CRC32: packet_crc32: %.8x calc_crc32: %.8x\n", @@ -1205,9 +1179,8 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num crc32 |= (uint32_t) this->pmt[program_count][section_length+3-1] ; /* Check CRC. */ - calc_crc32 = demux_ts_compute_crc32 (this, - this->pmt[program_count], - section_length+3-4, 0xffffffff); + calc_crc32 = _x_compute_crc32 (this->pmt[program_count], + section_length+3-4, 0xffffffff); if (crc32 != calc_crc32) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: demux error! PMT with invalid CRC32: packet_crc32: %#.8x calc_crc32: %#.8x\n", @@ -2028,8 +2001,6 @@ static void demux_ts_send_headers (demux_plugin_t *this_gen) { this->send_newpts = 1; - demux_ts_build_crc32_table (this); - this->status = DEMUX_OK ; this->send_end_buffers = 1; diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c index da6af0060..9b2730018 100644 --- a/src/demuxers/demux_tta.c +++ b/src/demuxers/demux_tta.c @@ -19,8 +19,6 @@ * * True Audio demuxer by Diego Pettenò <flameeyes@gentoo.org> * Inspired by tta libavformat demuxer by Alex Beregszaszi - * - * $Id: demux_tta.c,v 1.4 2007/03/29 16:46:23 dgp85 Exp $ */ #define LOG_MODULE "demux_tta" diff --git a/src/demuxers/demux_vmd.c b/src/demuxers/demux_vmd.c index a1b107288..8b0087417 100644 --- a/src/demuxers/demux_vmd.c +++ b/src/demuxers/demux_vmd.c @@ -27,8 +27,6 @@ * Note that the only way that this demuxer validates by content is by * checking the first 2 bytes, which are 0x2E 0x03 in a Sierra VMD file. * There is a 1/65536 chance of a false positive using this method. - * - * $Id: demux_vmd.c,v 1.4 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index f6b5caf7e..0439980f8 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -24,8 +24,6 @@ * possibly be seen in a VOC file. It only plays the first block in a file. * It will only play that block if it is PCM data. More variations will be * supported as they are encountered. - * - * $Id: demux_voc.c,v 1.41 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c index 31b33b8c6..3ce2ad705 100644 --- a/src/demuxers/demux_vox.c +++ b/src/demuxers/demux_vox.c @@ -21,9 +21,6 @@ /* * VOX Demuxer by Mike Melanson (melanson@pcisys.net) * This a demuxer for .vox files containing raw Dialogic ADPCM data. - * - * $Id: demux_vox.c,v 1.14 2007/01/19 00:26:40 dgp85 Exp $ - * */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 16e5da46c..40242476b 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -28,8 +28,6 @@ * However, seeking is infeasible due to the audio encoding: Each audio * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. - * - * $Id: demux_vqa.c,v 1.42 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index d306379e4..9b46336fe 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -21,8 +21,6 @@ /* * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide - * - * $Id: demux_wav.c,v 1.65 2007/03/17 20:57:04 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 7cd579ba9..a69c6b46a 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -23,8 +23,6 @@ * by Mike Melanson (melanson@pcisys.net) * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_wc3movie.c,v 1.54 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index 8c080bae1..9c5856710 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -23,8 +23,6 @@ * For more information regarding the YUV4MPEG2 file format and associated * tools, visit: * http://mjpeg.sourceforge.net/ - * - * $Id: demux_yuv4mpeg2.c,v 1.44 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c index ff55765c3..774329c05 100644 --- a/src/demuxers/demux_yuv_frames.c +++ b/src/demuxers/demux_yuv_frames.c @@ -20,8 +20,6 @@ */ /* - * $Id: demux_yuv_frames.c,v 1.24 2007/01/19 01:05:24 dgp85 Exp $ - * * dummy demultiplexer for raw yuv frames (delivered by v4l) */ diff --git a/src/demuxers/ebml.c b/src/demuxers/ebml.c index 00c8e99cd..ac44aecd7 100644 --- a/src/demuxers/ebml.c +++ b/src/demuxers/ebml.c @@ -19,9 +19,6 @@ * * EBML parser * a lot of ideas from the gstreamer parser - * - * $Id: ebml.c,v 1.4 2005/11/28 12:24:57 valtri Exp $ - * */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/demuxers/ebml.h b/src/demuxers/ebml.h index 194903a3d..35078c502 100644 --- a/src/demuxers/ebml.h +++ b/src/demuxers/ebml.h @@ -19,9 +19,6 @@ * * EBML parser * a lot of ideas from the gstreamer parser - * - * $Id: ebml.h,v 1.1 2004/01/05 00:40:54 tmattern Exp $ - * */ #ifndef EBML_H #define EBML_H diff --git a/src/demuxers/group_audio.c b/src/demuxers/group_audio.c index 887d9de63..8d6c18190 100644 --- a/src/demuxers/group_audio.c +++ b/src/demuxers/group_audio.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * This file contains plugin entries for several demuxers used in games - * - * $Id: group_audio.c,v 1.26 2007/03/03 02:06:09 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/group_audio.h b/src/demuxers/group_audio.h index 3431aaba2..11aac35d7 100644 --- a/src/demuxers/group_audio.h +++ b/src/demuxers/group_audio.h @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * $Id: group_audio.h,v 1.9 2006/12/26 16:59:55 dgp85 Exp $ */ #ifndef HAVE_GROUP_AUDIO_H diff --git a/src/demuxers/group_games.c b/src/demuxers/group_games.c index 3aea78fac..ad257c2fb 100644 --- a/src/demuxers/group_games.c +++ b/src/demuxers/group_games.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * This file contains plugin entries for several demuxers used in games - * - * $Id: group_games.c,v 1.15 2006/07/10 22:08:13 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/group_games.h b/src/demuxers/group_games.h index 4024f84cc..f93d4bb07 100644 --- a/src/demuxers/group_games.h +++ b/src/demuxers/group_games.h @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * $Id: group_games.h,v 1.3 2004/02/13 13:48:03 tmmm Exp $ */ #ifndef HAVE_GROUP_GAMES_H diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index 14090579e..8eb413f83 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -28,8 +28,6 @@ * unzip support * * ID3v2 specs: http://www.id3.org/ - * - * $Id: id3.c,v 1.13 2007/03/03 00:58:52 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h index e4d68f181..35f011f30 100644 --- a/src/demuxers/id3.h +++ b/src/demuxers/id3.h @@ -20,8 +20,6 @@ * ID3 tag parser * * Supported versions: v1, v1.1, v2.2, v2.3, v2.4 - * - * $Id: id3.h,v 1.6 2007/03/03 01:41:16 dgp85 Exp $ */ #ifndef ID3_H diff --git a/src/demuxers/iff.h b/src/demuxers/iff.h index 17c12bfe7..94830f69c 100644 --- a/src/demuxers/iff.h +++ b/src/demuxers/iff.h @@ -21,8 +21,6 @@ /* * IFF header file by Manfred Tremmel (Manfred.Tremmel@iiv.de) * Based on the information of the Amiga Developer CD - * - * $Id: iff.h,v 1.2 2004/02/25 18:57:36 manfredtremmel Exp $ */ #ifndef IFFP_IFF_H diff --git a/src/demuxers/matroska.h b/src/demuxers/matroska.h index f7a7eac2b..6806c207d 100644 --- a/src/demuxers/matroska.h +++ b/src/demuxers/matroska.h @@ -16,9 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * $Id: matroska.h,v 1.11 2007/01/07 12:33:50 molivier Exp $ - * */ #ifndef MATROSKA_H #define MATROSKA_H |