From: <li...@yo...> - 2007-08-30 14:21:18
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1188483619 -3600 # Node ID de1f9dcd0565c40ea0e198e7084b574e930128e2 # Parent 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca # Parent e8b9fca235669cea7158f3554579ce3dbfec9f7f Merge from 1.2 main. diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca .hgignore --- a/.hgignore Thu Aug 30 15:20:19 2007 +0100 +++ b/.hgignore Thu Jun 21 23:28:29 2007 +0100 @@ -43,6 +43,7 @@ debian/libxine-dev debian/libxine-dev debian/libxine2 debian/libxine2-dbg +debian/libxine2-doc debian/tmp debian/*.debhelper debian/*.substvars @@ -80,3 +81,8 @@ po/remove-potcdate.sed po/remove-potcdate.sed src/libffmpeg/ffmpeg_config.h +src/video_out/libdha/pci_dev_ids.c +src/video_out/libdha/pci_ids.h +src/video_out/libdha/pci_names.[ch] +src/video_out/libdha/pci_vendors.h + diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca .hgsigs --- a/.hgsigs Thu Aug 30 15:20:19 2007 +0100 +++ b/.hgsigs Thu Jun 21 23:28:29 2007 +0100 @@ -1,1 +1,2 @@ 5e6d0656ac4efdc1a89ed0fc32f11050f4a22970 5e6d0656ac4efdc1a89ed0fc32f11050f4a22970 0 iD8DBQBGZ207sBKtjPGfWZ8RAhdEAKCrkwiBT6bTof7ro5QQwewRfF/dMACffsvfK42+ahQrjpSfQxEp6k7RpCI= +42358e16442fe54fa554006e0b0bafd51e065c32 0 iD8DBQBG0xz0zbwfTn7RbcARAoD3AJ4012pabmpQvCKKDokZNyZzfPIbWgCfRk5FRly/Eei/xXnSaT54XHAT5KM= diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca .hgtags --- a/.hgtags Thu Aug 30 15:20:19 2007 +0100 +++ b/.hgtags Thu Jun 21 23:28:29 2007 +0100 @@ -61,3 +61,4 @@ 204b8e92463b592e5c220b56f186a6d4d1007cf9 204b8e92463b592e5c220b56f186a6d4d1007cf9 xine-lib-1_1_5-release 7b60f85a95345c41fb074dc5e3f7355d9e72968e xine-lib-1_1_6-release ab1531337553ad5eac24a69ac665eae33916b423 xine-lib-1_1_7-release +e0a332b9d3e8bb3fad4d7feac1e519292b062056 xine-lib-1_1_8-release diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca ChangeLog --- a/ChangeLog Thu Aug 30 15:20:19 2007 +0100 +++ b/ChangeLog Thu Jun 21 23:28:29 2007 +0100 @@ -34,8 +34,11 @@ xine-lib (1.1.90) (Unreleased) consider alternative daemons. Note: aRTs will not be present in KDE 4. * Convert the FAQ and the Hacker's Guide from DocBook SGML to DocBook 4.4 XML, and the figures from fig files to SVG files. - -xine-lib (1.1.8) (Unreleased) + * The XML parser no longer ignores <?...?> elements. + Such elements are handled as if they were after the XML content for + compatibility reasons, though they must appear before it. + +xine-lib (1.1.8) * Send a channel-changed event to the frontend when receiving the SYNC string from last.fm streaming server. * Disable mediaLib support by default (the licenses probably disallow the @@ -43,6 +46,23 @@ xine-lib (1.1.8) (Unreleased) capable boxes it's probably worse than our own code). * Rename endianness-reading macros so that they don't collide with Solaris system macros. BE_/LE_ are now _X_BE_ and _X_LE_. + * Add an extra function to allow front ends to rename their old, + badly-named configuration items. + * Various build fixes and cleanups for Solaris, plugin dependencies etc. + * Fix some memory leaks in the Vorbis decoder and video overlays. + * Fix a problem with the goom plugin which could cause it to stop working. + * Clean up "%" unescaping in MRLs; correctly handle "%" in DVD and VCD MRLs. + * Fix a crash with "dvb:/". + * DVB subtitle fixes: deadlock prevention, thread leakage, spec compliance. + * Allow the DVB input plugin to timeout if it is receiving no signal. + * Fix an audio resampling problem which was causing regular clicking. + * Fix build with recent glibc and a debugging #define. [Bug 1773769] + * Fix handling of multiple MPEG TS audio streams & subtitle languages. + * Add colouring for bold & italic in text subtitles. + * Simple scaling of subtitles to fit the frame width (intended to cope + with common DVB resolutions such as 544x576). + * Various small video frame-handling bug fixes. + * Add options to control bob deinterlacing in the XxMC video output plugin. xine-lib (1.1.7) * Support libdca (new name for libdts) by shuffling around the dts.h file. diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca TODO --- a/TODO Thu Aug 30 15:20:19 2007 +0100 +++ b/TODO Thu Jun 21 23:28:29 2007 +0100 @@ -19,6 +19,8 @@ For 1.2 series - handle gracefully the runtime removal of the audio output device (being it a physical removal for USB devices or a missing output on a client-server design like PulseAudio, ESounD or Jack); +- review media_eject_media, possibly rewrite to use libcdio; +- improve error reporting (for when demuxer/decoder plugins aren't found); - HTTPS. known bugs @@ -27,6 +29,7 @@ known bugs - frame allocation problem with h264 streams using > 15 reference frames - dvdnav time search function does not use the time table, but interpolates only cell times +- apparently, dvb:// (but not dvb://CHANNEL) is broken for ATSC requested/planned features diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca debian/changelog --- a/debian/changelog Thu Aug 30 15:20:19 2007 +0100 +++ b/debian/changelog Thu Jun 21 23:28:29 2007 +0100 @@ -1,4 +1,4 @@ xine-lib (1.2.0~hg-0) unstable; urgency= -xine-lib (1.2.0~hg-0) unstable; urgency=low +xine-lib (1.2.0~hg-0) experimental; urgency=low * Hg snapshot. * Adjust for libxine2. diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca debian/control --- a/debian/control Thu Aug 30 15:20:19 2007 +0100 +++ b/debian/control Thu Jun 21 23:28:29 2007 +0100 @@ -1,10 +1,13 @@ Source: xine-lib -Source: xine-lib +Source: xine-lib-12 Section: libs Priority: optional -Maintainer: Siggi Langauf <si...@de...> -Uploaders: Philipp Matthias Hahn <pm...@de...>, Reinhard Tartler <sir...@ta...> +Maintainer: Darren Salt <li...@yo...> +Uploaders: Reinhard Tartler <sir...@ta...> Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config, automake1.9, autoconf, libtool, + libxcb-xinerama0-dev | libxv-dev (<< 1.0.3), libxcb-xv0-dev | libxv-dev (<< 1.0.3), + libxcb-xvmc0-dev | libxv-dev (<< 1.0.3), libxcb-shm0-dev | libxv-dev (<< 1.0.3), + libxcb-shape0-dev | libxv-dev (<< 1.0.3), libxinerama-dev, libxv-dev, libxvmc-dev, libxt-dev, libdirectfb-dev (>= 0.9.22), libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], @@ -22,7 +25,7 @@ Build-Conflicts: libdvdnav-dev, libvcdin Build-Conflicts: libdvdnav-dev, libvcdinfo-dev Standards-Version: 3.7.2 -Package: libxine2-dev +Package: libxine-dev Architecture: any Section: libdevel Depends: libxine2 (= ${Source-Version}), libc6-dev, zlib1g-dev | libz-dev, libslang2-dev | slang1-dev, libfreetype6-dev diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca debian/rules --- a/debian/rules Thu Aug 30 15:20:19 2007 +0100 +++ b/debian/rules Thu Jun 21 23:28:29 2007 +0100 @@ -68,6 +68,7 @@ CONFIGURE_FLAGS := --prefix=/usr \ --with-external-libmad \ --with-external-a52dec \ --with-external-libdts \ + --with-freetype \ --with-wavpack \ $(DEB_BUILD_CONFIG_OPTIONS) \ CFLAGS="$(CFLAGS)" @@ -106,7 +107,7 @@ clean: # remove more cruft leftover by autohell rm -f doc/faq/faq.html doc/faq/faq.txt doc/hackersguide/hackersguide.html m4/caca.m4 -test -f .noauto || find . -name Makefile.in -print | xargs -r rm - test -f .noauto || rm -rf compile config.guess configure depcomp install-sh ltmain.sh missing aclocal.m4 config.h.in + test -f .noauto || rm -rf compile config.guess configure depcomp install-sh ltmain.sh missing aclocal.m4 include/configure.h.in dh_clean install: build diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca doc/README.dvb --- a/doc/README.dvb Thu Aug 30 15:20:19 2007 +0100 +++ b/doc/README.dvb Thu Jun 21 23:28:29 2007 +0100 @@ -4,52 +4,54 @@ xine Digital TV (DVB) xine can be used to watch digital television. -xine supports Digital TV (Digital Video Broadcasting - DVB) cards -using the Linux DVB driver from Convergence (http://www.linuxtv.org). -DVB-S (direct satellite reception), DVB-C (Cable) and DVB-T (Teresstrical) -cards should be supported (e.g. the Hauppauge WinTV Nova DVB-S card). +xine supports Digital TV (Digital Video Broadcasting - DVB) cards using the +Linux DVB drivers in your kernel or from http://www.linuxtv.org/. -driver download and installation +Many DVB-S (direct satellite reception), DVB-C (Cable) and DVB-T and ATSC +(Terrestrial) devices are supported via these drivers. + + +Driver download and installation -------------------------------- -Download and install the drivers from http://www.linuxtv.org, the 1.0.0 or later release -should work fine. +You may need to download and install drivers for recent hardware. See the +"Getting Started" section at http://www.linuxtv.org/wiki/index.php/ . -You will need kernel sources configured for your configuration for -a successfull build, preferably in /usr/src/linux plus a link to them in -/lib/modules/<kernel-version>/build. Once you have that you should be ready -to compile the driver +You will probably need to add yourself to group "video". With a DVB device +installed and recognised: -# cd linuxtv-dvb-1.0.0/driver -# make + $ ls -l /deb/dvb/adapter0 + total 0 + crw-rw---- 1 root video 212, 4 2007-08-07 15:33 demux0 + crw-rw---- 1 root video 212, 5 2007-08-07 15:33 dvr0 + crw-rw---- 1 root video 212, 3 2007-08-07 15:33 frontend0 + crw-rw---- 1 root video 212, 7 2007-08-07 15:33 net0 -if that doesn't fail, do a +This shows that you need to be either root or in group "video" to be able to +use the DVB device. -# make insmod +You can find out if you're already in this group by using the "groups" +command in a terminal. If you aren't, then trying to use the DVB plugin will +cause a "no input plugin" error: this is somewhat misleading because the DVB +plugin was actually found but it failed because it couldn't open the device +nodes. -UPDATE: the latest 2.6 kernels include the necessary drivers for most - cards, check on the linuxtv.org website for information about supported - cards, or read the documentation available in the linux kernel - sources (linux/Documentation/dvb/*). +Adding yourself to group "video" is the best way; one of -to load the generated modules into your running kernel. If everything went -fine, you should have something like + # adduser fred video + $ sudo adduser fred video -DVB: registering new adapter (TT-Budget/WinTV-NOVA-S PCI). -PCI: Found IRQ 10 for device 00:0d.0 -PCI: Sharing IRQ 10 with 00:0c.0 -DVB: registering frontend 0:0 (stv0299 based (e.g. Alps BSRU6 or LG TDQB-S00x))... +will do the job for a user named "fred". Note that the change won't take +effect until after fred has logged out if he's currently logged in. -in your dmesg. - -install a channel list +Install a channel list ---------------------- -xine's dvb input plugin needs a channel/transponder list that fits your -dvb equipment. xine now uses the channels.conf format of szap, czap and -tzap as appropriate for DVB-S, DVB-C and DVB-T. it will search the channel -list file in ~/.config/xine/channels.conf +xine-lib's dvb input plugin needs a channel/transponder list that fits your +dvb equipment. xine-lib uses the channels.conf format of szap, czap and tzap +as appropriate for DVB-S, DVB-C and DVB-T. It will search the channel list +file in ~/.config/xine/channels.conf. channel list format for DVB-S: (satellite) ------------------------------------------- @@ -64,79 +66,71 @@ station name:frequency:config options go station name:frequency:config options go on seemingly forever ... :vpid:apid:serviceid ------------------------------------------- -you automatically scan for all available channels using the scan utility -which comes with the dvb package. compile it using something like +You scan for all available channels using the scan utility which comes with +the dvb-apps package (also known as dvb-utils). See +http://www.linuxtv.org/wiki/index.php/Scan for more information. -# cd linuxtv-dvb-1.0.0/apps/scan -# make + $ scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-PontopPike >~/.config/xine/channels.conf + $ scan Hotbird-13.0 >~/.config/xine/channels.conf -then start scanning +This can take a while. In a DiSEqC environment, use the -s N switch to +select different satellites to scan and paste the results in one big +channels.conf file. As always, please be sure to read the man page for the +version of the tool you are using. -# scan >~/.config/xine/channels.conf +HINT: you might want to manually sort the channels.conf file to have your +favourite channels at the top and maybe remove any scrambled channels to +which you don't have access. -newer versions of scan (after July 2004) are called dvbscan, but you can use it much the same way: -# dvbscan Hotbird-13.0 >~/.config/xine/channels.conf - -this can take a while. in a DiSEqC environment, use the -s N switch to select -different sattelites to scan and paste the results in one big channels.conf file. As always, -please be sure to read the man page for the version of the tool you are using. - -HINT 1: you might want to manually sort the channels.conf file to have your favourite - channels at the top and maybe remove scrambled channels which you don't have access to. - - - ************************ If the dvb plugin doesn't seem to work for you ****************** -* if xine doesn't seem to work for you, double check to make sure that the channels.conf * -* file is _NOT_ in vdr format, which looks something like this: * -* WINSA:557500:I999B7C23D0M64T8G8Y0:T:27500:33:36:47:0:1:0:0:0 * - ****************************************************************************************** - -using xine to watch digital television +Using xine to watch digital television -------------------------------------- -make sure you have a recent libxine and frontend installed (latest CVS as of -this writing). then simply start something like +Make sure you have a recent libxine and front end installed, then simply +start something like -$ gxine dvb:// + $ gxine dvb:// -or click on the DVB button in xine-ui. you should be able to zap around using -the NumPad-9 / NumPad-3 keys, the xine playlist, or using the next/previous chapter -buttons in your gui. +or, perhaps, click on the DVB button in xine-ui. You should be able to zap +around using the NumPad-9 / NumPad-3 keys, the xine playlist, or using the +next/previous chapter buttons in your gui. -An OSD menu is available too. Press NumPad-8 / NumPad-2 to scroll -through the channels, then press NumPad-Enter to switch to the channel -you have selected. As of 06-12-2004, the channel list can be brought up and scrolled -through via the wheel on many mouses. Use the left mouse button to switch to -the channel you've selected. The side buttons (6 & 7) can be used to rapidly switch -to previous/next channels, if they are available on your mouse. +An OSD menu is available too. Press NumPad-8 / NumPad-2 to scroll through +the channels, then press NumPad-Enter to switch to the channel you have +selected. The channel list can be brought up and scrolled through via the +mouse wheel. Use the left mouse button to switch to the channel you've +selected. The side buttons (6 & 7) can be used to rapidly switch to +previous/next channels, if they are available on your mouse. -You can use MENU3 (F2 in xine-ui, F3 in gxine) to zoom into the centre of a videostream. -This will allow you to view 4:3 content that has been embedded into a -16:9 stream in fullscreen (no more black borders). Press the key again -to return to normal viewing. There is also an option in the xine +You can use MENU3 (F2 in xine-ui, F3 in gxine) to zoom into the centre of a +videostream. This will allow you to view 4:3 content that has been embedded +into a 16:9 stream in fullscreen (no more black borders). Press the key +again to return to normal viewing. There is also an option in the xine preferences to zoom automatically when using xine to view DVB. -MENU7 (F6 in xine-ui or F7 in gxine) will toggle viewing of the current channels' -Electronic Program Guide (information on the current/next program) on the OSD, if available. +MENU7 (F6 in xine-ui or F7 in gxine) will toggle viewing of the current +channel's Electronic Program Guide (information on the current/next program) +on the OSD, if available. -HINT: if audio or video is stuttering, pause (space key) shortly -to give xine a chance to fill up it's buffers. If watching a large HDTV stream, you -may need to increase the xine video & audio buffer size - increasing audio buffers to -300 and video buffers to 700 has been known to work with streams up to 1920x1088 in size. +HINT: if audio or video is stuttering, pause (space key) shortly to give +xine-lib a chance to fill its buffers. If watching a large HDTV stream, you +may need to increase the xine video & audio buffer size - increasing audio +buffers to 300 and video buffers to 700 has been known to work with streams +up to 1920x1088 in size. -recording digital television +Recording digital television ---------------------------- -there is a very simple vcr-like feature built into the xine engine. just press -MENU2 (that is F2 in gxine, or F1 in xine-ui for example) to start/stop recording -the currently displayed program to your local disc. a small osd in the upper -left corner of your screen will tell you the file name the recorded stream is -written to. You can select the directory to save to in the xine configuration under -the MISC tab, otherwise the plugin will record to your home directory. You can -pause the recording at any time by pressing MENU4 (F3 in xine-ui, F4 in gxine). -An OSD in the top left hand corner will notify you of the status of the recording. +There is a very simple VCR-like feature built into the xine engine. just +press MENU2 (that is F2 in gxine, or F1 in xine-ui for example) to +start/stop recording the currently displayed program to your local disc. A +small OSD message in the upper left corner of your screen will tell you the +file name the recorded stream is being written to. You can select the +directory to save to in the xine configuration under the MISC tab, otherwise +the plugin will record to your home directory. You can pause the recording +at any time by pressing MENU4 (F3 in xine-ui, F4 in gxine). An OSD in the +top left hand corner will notify you of the status of the recording. Pressing MENU4 again will resume recording. Have fun. diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca doc/man/en/xine.5 --- a/doc/man/en/xine.5 Thu Aug 30 15:20:19 2007 +0100 +++ b/doc/man/en/xine.5 Thu Jun 21 23:28:29 2007 +0100 @@ -38,7 +38,7 @@ to read from. Valid MRLs may be plain fi .br .BI vcd://[<CD_image>|<device_name>][@[letter]<number>] .br -.BI vcdo://... +.BI vcdo://<track_number> .br .BI cdda:/[<device>][/<track-number>] .LP @@ -109,11 +109,11 @@ After the optional device name or file n After the optional device name or file name, you can name the kind of unit, preceded by a colon. An MRL which ends in a colon is like not adding it at all: the default entry type and number is used. Items come in 4 flavours: -\fB"Track"\fP, \fB"Entry"\fP, \fB"Playback"\fP and \fB"Segment"\fP. These +"\fBTrack\fP", "\fBEntry\fP", "\fBPlayback\fP" and "\fBSegment\fP". These units are indicated with the capital first letter of each type: \fBT\fP, \fBE\fP, \fBP\fP, \fBS\fP, \fBs\fP. An uppercase \fBS\fP in the MRL display -indicates a NTS segment while a lowercase \fBS\fP indicates a PAL segment. -However when you enter an MRL, the case of these letters is insignificant. +indicates a NTSC segment while a lowercase \fBs\fP indicates a PAL segment. +However, when you enter an MRL, the case of these letters is insignificant. Depending on the Video CD, you might not have any playable segments (\fBS\fP,\fBs\fP) or playback control (\fBP\fP). If you give a MRL that diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca include/xine.h.in --- a/include/xine.h.in Thu Aug 30 15:20:19 2007 +0100 +++ b/include/xine.h.in Thu Jun 21 23:28:29 2007 +0100 @@ -1531,6 +1531,15 @@ int xine_config_lookup_entry (xine_t *s */ void xine_config_update_entry (xine_t *self, const xine_cfg_entry_t *entry) XINE_PROTECTED; + +/* + * translation of old configuration entry names + */ +typedef struct { + const char *old_name, *new_name; +} xine_config_entry_translation_t; + +void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED; /* * load/save config data from/to afile (e.g. $HOME/.xine/config) diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca lib/memmem.c --- a/lib/memmem.c Thu Aug 30 15:20:19 2007 +0100 +++ b/lib/memmem.c Thu Jun 21 23:28:29 2007 +0100 @@ -21,7 +21,7 @@ #include <string.h> /* Return the first occurrence of NEEDLE in HAYSTACK. */ -void *xine_internal_memmem (const void *haystack, size_t haystack_len, +void *xine_private_memmem (const void *haystack, size_t haystack_len, const void *needle, size_t needle_len) { const char *begin; diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca po/POTFILES.in --- a/po/POTFILES.in Thu Aug 30 15:20:19 2007 +0100 +++ b/po/POTFILES.in Thu Jun 21 23:28:29 2007 +0100 @@ -5,7 +5,6 @@ contrib/libmpcdec/synth_filter.c contrib/libmpcdec/synth_filter.c lib/hstrerror.c src/audio_out/audio_alsa_out.c -src/audio_out/audio_arts_out.c src/audio_out/audio_coreaudio_out.c src/audio_out/audio_directx2_out.c src/audio_out/audio_directx_out.c diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/flac_decoder.c --- a/src/combined/flac_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/flac_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -248,7 +248,7 @@ flac_decode_data (audio_decoder_t *this_ if (!this->output_open) { - this->output_open = this->stream->audio_out->open ( + this->output_open = (this->stream->audio_out->open) ( this->stream->audio_out, this->stream, bits_per_sample, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/nsf_decoder.c --- a/src/combined/nsf_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/nsf_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -129,7 +129,7 @@ static void nsf_decode_data (audio_decod /* if the audio output is not open yet, open the audio output */ if (!this->output_open) { - this->output_open = this->stream->audio_out->open( + this->output_open = (this->stream->audio_out->open) ( this->stream->audio_out, this->stream, this->bits_per_sample, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/wavpack_decoder.c --- a/src/combined/wavpack_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/wavpack_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -173,7 +173,7 @@ static void wavpack_decode_data (audio_d if (!this->output_open) { - this->output_open = this->stream->audio_out->open ( + this->output_open = (this->stream->audio_out->open) ( this->stream->audio_out, this->stream, this->bits_per_sample, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/wavpack_demuxer.c --- a/src/combined/wavpack_demuxer.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/wavpack_demuxer.c Thu Jun 21 23:28:29 2007 +0100 @@ -28,6 +28,7 @@ #define LOG_MODULE "demux_wavpack" #define LOG_VERBOSE +#define LOG #include "xine_internal.h" #include "xineutils.h" @@ -230,11 +231,12 @@ static int demux_wv_send_chunk(demux_plu input_time_guess *= buf->extra_info->input_normpos; input_time_guess /= 65535; buf->extra_info->input_time = input_time_guess; - - bytes_to_read_now = ( bytes_to_read > buf->max_size ) ? buf->max_size : bytes_to_read; + + if ( ! header_sent ) + offset = sizeof(wvheader_t); + + bytes_to_read_now = ( bytes_to_read+offset > buf->max_size ) ? buf->max_size-offset : bytes_to_read; if ( ! header_sent ) { - bytes_to_read_now -= (offset = sizeof(wvheader_t)); - header_sent = 1; xine_fast_memcpy(buf->content, &header, sizeof(wvheader_t)); } diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/xine_speex_decoder.c --- a/src/combined/xine_speex_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/xine_speex_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -272,7 +272,7 @@ static void speex_decode_data (audio_dec if (!this->output_open) { this->output_open = - this->stream->audio_out->open(this->stream->audio_out, + (this->stream->audio_out->open) (this->stream->audio_out, this->stream, 16, this->rate, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/xine_theora_decoder.c --- a/src/combined/xine_theora_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/xine_theora_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -338,7 +338,7 @@ static video_decoder_t *theora_open_plug theora_comment_init (&this->t_comment); theora_info_init (&this->t_info); - stream->video_out->open (stream->video_out, stream); + (stream->video_out->open) (stream->video_out, stream); return &this->theora_decoder; diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/combined/xine_vorbis_decoder.c --- a/src/combined/xine_vorbis_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/combined/xine_vorbis_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -177,7 +177,7 @@ static void vorbis_decode_data (audio_de this->convsize=MAX_NUM_SAMPLES/this->vi.channels; if (!this->output_open) { - this->output_open = this->stream->audio_out->open(this->stream->audio_out, + this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream, 16, this->vi.rate, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/demuxers/demux_matroska.c --- a/src/demuxers/demux_matroska.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/demuxers/demux_matroska.c Thu Jun 21 23:28:29 2007 +0100 @@ -610,8 +610,7 @@ static void init_codec_real(demux_matros track->fifo->put (track->fifo, buf); } - -static void init_codec_vorbis(demux_matroska_t *this, matroska_track_t *track) { +static void init_codec_xiph(demux_matroska_t *this, matroska_track_t *track) { buf_element_t *buf; uint8_t nb_lace; int frame[3]; @@ -1373,6 +1372,10 @@ static int parse_track_entry(demux_matro init_codec = init_codec_real; } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MJPEG)) { + } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_THEORA)) { + lprintf("MATROSKA_CODEC_ID_V_THEORA\n"); + track->buf_type = BUF_VIDEO_THEORA_RAW; + init_codec = init_codec_xiph; } else if ((!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L1)) || (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L2)) || (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L3))) { @@ -1397,7 +1400,7 @@ static int parse_track_entry(demux_matro lprintf("MATROSKA_CODEC_ID_A_VORBIS\n"); track->buf_type = BUF_AUDIO_VORBIS; - init_codec = init_codec_vorbis; + init_codec = init_codec_xiph; } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_ACM)) { xine_waveformatex *wfh; @@ -1853,6 +1856,7 @@ static int parse_block (demux_matroska_t gap = flags & 1; lacing = (flags >> 1) & 0x3; + fprintf(stderr, "lacing: %x\n", lacing); if (!find_track_by_id(this, (int)track_num, &track)) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/demuxers/demux_ts.c --- a/src/demuxers/demux_ts.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/demuxers/demux_ts.c Thu Jun 21 23:28:29 2007 +0100 @@ -299,6 +299,7 @@ typedef struct { 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 * and audio PIDs, we keep the index of the corresponding entry @@ -341,6 +342,8 @@ typedef struct { int32_t npkt_read; uint8_t buf[BUF_SIZE]; /* == PKT_SIZE * NPKT_PER_READ */ + + int numPreview; } demux_ts_t; @@ -637,6 +640,7 @@ static void demux_ts_parse_pat (demux_ts if (this->pmt_pid[program_count] != pmt_pid) { this->pmt_pid[program_count] = pmt_pid; this->audio_tracks_count = 0; + this->last_pmt_crc = 0; this->videoPid = INVALID_PID; this->spu_pid = INVALID_PID; } @@ -735,12 +739,11 @@ static int demux_ts_parse_pes_header (xi if (stream_id == 0xbd) { - int track, spu_id; + int spu_id; 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 * do not include any of the ac3 header info in their audio tracks @@ -774,7 +777,7 @@ static int demux_ts_parse_pes_header (xi m->content = p+4; m->size = packet_len - 4; - m->type |= BUF_AUDIO_A52 + track; + m->type |= BUF_AUDIO_A52; return 1; } else if ((p[0]&0xf0) == 0xa0) { @@ -790,7 +793,7 @@ static int demux_ts_parse_pes_header (xi m->content = p+pcm_offset; m->size = packet_len-pcm_offset; - m->type |= BUF_AUDIO_LPCM_BE + track; + m->type |= BUF_AUDIO_LPCM_BE; return 1; } @@ -821,26 +824,22 @@ static int demux_ts_parse_pes_header (xi } else if ((stream_id & 0xe0) == 0xc0) { - int track; - - track = stream_id & 0x1f; - m->content = p; m->size = packet_len; switch (m->descriptor_tag) { case ISO_11172_AUDIO: case ISO_13818_AUDIO: lprintf ("demux_ts: found MPEG audio track.\n"); - m->type |= BUF_AUDIO_MPEG + track; + m->type |= BUF_AUDIO_MPEG; break; case ISO_13818_PART7_AUDIO: case ISO_14496_PART3_AUDIO: lprintf ("demux_ts: found AAC audio track.\n"); - m->type |= BUF_AUDIO_AAC + track; + m->type |= BUF_AUDIO_AAC; break; default: lprintf ("demux_ts: unknown audio type: %d, defaulting to MPEG.\n", m->descriptor_tag); - m->type |= BUF_AUDIO_MPEG + track; + m->type |= BUF_AUDIO_MPEG; break; } return 1; @@ -894,6 +893,16 @@ static void demux_ts_buffer_pes(demux_ts m->buf->decoder_flags |= BUF_FLAG_SPECIAL; m->buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE; m->buf->decoder_info[2] = SPU_DVD_SUBTYPE_PACKAGE; + } + else { + if (this->numPreview<5) + ++this->numPreview; + if ( this->numPreview==1 ) + m->buf->decoder_flags=BUF_FLAG_HEADER | BUF_FLAG_FRAME_END; + else if ( this->numPreview<5 ) + m->buf->decoder_flags=BUF_FLAG_PREVIEW; + else + m->buf->decoder_flags=BUF_FLAG_FRAME_END; } m->buf->pts = m->pts; m->buf->decoder_info[0] = 1; @@ -1199,11 +1208,24 @@ printf("Program Number is %i, looking fo crc32,calc_crc32); return; } + else { #ifdef TS_PMT_LOG - else { printf ("demux_ts: PMT CRC32 ok.\n"); - } -#endif +#endif + if ( crc32==this->last_pmt_crc ) { +#ifdef TS_PMT_LOG + printf("demux_ts: PMT with CRC32=%d already parsed. Skipping.\n", crc32); +#endif + return; + } + else { +#ifdef TS_PMT_LOG + printf("demux_ts: new PMT, parsing...\n"); +#endif + this->last_pmt_crc = crc32; + } + } + /* * ES definitions start here...we are going to learn upto one video @@ -1910,6 +1932,7 @@ static void demux_ts_event_handler (demu this->spu_pid = INVALID_PID; this->spu_media = 0; this->spu_langs_count= 0; + this->last_pmt_crc = 0; _x_demux_control_start (this->stream); break; @@ -1985,6 +2008,7 @@ static void demux_ts_send_headers (demux this->videoPid = INVALID_PID; this->audio_tracks_count = 0; this->media_num= 0; + this->last_pmt_crc = 0; _x_demux_control_start (this->stream); @@ -2090,31 +2114,21 @@ static int demux_ts_get_optional_data(de case DEMUX_OPTIONAL_DATA_AUDIOLANG: if ((channel >= 0) && (channel < this->audio_tracks_count)) { if(this->audio_tracks[channel].lang) - strcpy(str, this->audio_tracks[channel].lang); + strcpy(str, this->audio_tracks[channel].lang); else - sprintf(str, "%3i", _x_get_audio_channel(this->stream)); + sprintf(str, "%3i", _x_get_audio_channel(this->stream)); } - else - { - snprintf(str, XINE_LANG_MAX, "%3i", _x_get_audio_channel(this->stream)); - } + else { + snprintf(str, XINE_LANG_MAX, "%3i", _x_get_audio_channel(this->stream)); + } return DEMUX_OPTIONAL_SUCCESS; case DEMUX_OPTIONAL_DATA_SPULANG: - if (this->current_spu_channel >= 0 - && this->current_spu_channel < this->spu_langs_count) - { - memcpy(str, this->spu_langs[this->current_spu_channel].desc.lang, 3); - str[3] = 0; - } - else if (this->current_spu_channel == -1) - { - strcpy(str, "none"); - } - else - { - snprintf(str, XINE_LANG_MAX, "%3i", this->current_spu_channel); - } + if (channel>=0 && channel<this->spu_langs_count) { + memcpy(str, this->spu_langs[channel].desc.lang, 3); + str[3] = 0;} + else + strcpy(str, "none"); return DEMUX_OPTIONAL_SUCCESS; default: @@ -2239,6 +2253,7 @@ static demux_plugin_t *open_plugin (demu this->scrambled_npids = 0; this->videoPid = INVALID_PID; this->audio_tracks_count = 0; + this->last_pmt_crc = 0; this->rate = 16000; /* FIXME */ @@ -2255,6 +2270,8 @@ static demux_plugin_t *open_plugin (demu /* dvb */ this->event_queue = xine_event_new_queue (this->stream); + + this->numPreview=0; return &this->demux_plugin; } @@ -2317,3 +2334,4 @@ const plugin_info_t xine_plugin_info[] E { PLUGIN_DEMUX, 26, "mpeg-ts", XINE_VERSION_CODE, &demux_info_ts, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; + diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/demuxers/matroska.h --- a/src/demuxers/matroska.h Thu Aug 30 15:20:19 2007 +0100 +++ b/src/demuxers/matroska.h Thu Jun 21 23:28:29 2007 +0100 @@ -264,6 +264,7 @@ struct matroska_track_s { #define MATROSKA_CODEC_ID_V_REAL_RV30 "V_REAL/RV30" #define MATROSKA_CODEC_ID_V_REAL_RV40 "V_REAL/RV40" #define MATROSKA_CODEC_ID_V_MJPEG "V_MJPEG" +#define MATROSKA_CODEC_ID_V_THEORA "V_THEORA" #define MATROSKA_CODEC_ID_A_MPEG1_L1 "A_MPEG/L1" #define MATROSKA_CODEC_ID_A_MPEG1_L2 "A_MPEG/L2" diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/dxr3/dxr3_decode_video.c --- a/src/dxr3/dxr3_decode_video.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/dxr3/dxr3_decode_video.c Thu Jun 21 23:28:29 2007 +0100 @@ -294,7 +294,7 @@ static video_decoder_t *dxr3_open_plugin /* the dxr3 needs a longer prebuffering to have time for its internal decoding */ this->stream->metronom->set_option(this->stream->metronom, METRONOM_PREBUFFER, 90000); - stream->video_out->open(stream->video_out, stream); + (stream->video_out->open) (stream->video_out, stream); class->instance = 1; diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_dvb.c --- a/src/input/input_dvb.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_dvb.c Thu Jun 21 23:28:29 2007 +0100 @@ -336,6 +336,8 @@ typedef struct { /* scratch buffer for forward seeking */ char seek_buf[BUFSIZE]; + /* Is the GUI enabled at all? */ + int dvb_gui_enabled; /* simple vcr-like functionality */ int record_fd; int record_paused; @@ -1006,6 +1008,9 @@ static int tuner_tune_it (tuner_t *this, struct dvb_frontend_event event; unsigned int strength; struct pollfd pfd[1]; + xine_cfg_entry_t config_tuning_timeout; + struct timeval time_now; + struct timeval tuning_timeout; /* discard stale events */ while (ioctl(this->fd_frontend, FE_GET_EVENT, &event) != -1); @@ -1033,6 +1038,19 @@ static int tuner_tune_it (tuner_t *this, return 0; } } + + xine_config_lookup_entry(this->xine, "media.dvb.tuning_timeout", &config_tuning_timeout); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "input_dvb: media.dvb.tuning_timeout is %d\n", config_tuning_timeout.num_value ); + + if( config_tuning_timeout.num_value != 0 ) { + gettimeofday( &tuning_timeout, NULL ); + if( config_tuning_timeout.num_value < 5 ) + tuning_timeout.tv_sec += 5; + else + tuning_timeout.tv_sec += config_tuning_timeout.num_value; + } + + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "input_dvb: tuner_tune_it - waiting for lock...\n" ); do { status = 0; @@ -1045,8 +1063,20 @@ static int tuner_tune_it (tuner_t *this, if (status & FE_HAS_LOCK) { break; } - usleep(500000); - print_error("Trying to get lock..."); + + /* FE_TIMEDOUT does not happen in a no signal condition. + * Use the tuning_timeout config to prevent a hang in this loop + */ + if( config_tuning_timeout.num_value != 0 ) { + gettimeofday( &time_now, NULL ); + if( time_now.tv_sec > tuning_timeout.tv_sec ) { + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "input_dvb: No FE_HAS_LOCK before timeout\n"); + break; + } + } + + usleep(10000); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "Trying to get lock..."); } while (!(status & FE_TIMEDOUT)); /* inform the user of frontend status */ @@ -2478,7 +2508,8 @@ static off_t dvb_plugin_read (input_plug if (!this->tuned_in) return 0; - dvb_event_handler (this); + if (this->dvb_gui_enabled) + dvb_event_handler (this); #ifdef LOG_READS xprintf(this->class->xine,XINE_VERBOSITY_DEBUG, "input_dvb: reading %" PRIdMAX " bytes...\n", (intmax_t)len); @@ -2743,6 +2774,11 @@ static int dvb_plugin_open(input_plugin_ xine_cfg_entry_t zoomdvb; xine_cfg_entry_t adapter; xine_cfg_entry_t lastchannel; + xine_cfg_entry_t gui_enabled; + + xine_config_lookup_entry(this->stream->xine, "media.dvb.gui_enabled", &gui_enabled); + this->dvb_gui_enabled = gui_enabled.num_value; + xprintf(this->class->xine, XINE_VERBOSITY_LOG, _("input_dvb: DVB GUI %s\n"), this->dvb_gui_enabled ? "enabled" : "disabled"); xine_config_lookup_entry(this->stream->xine, "media.dvb.adapter", &adapter); @@ -2969,15 +3005,16 @@ static int dvb_plugin_open(input_plugin_ this->event_queue = xine_event_new_queue(this->stream); #ifdef EPG_UPDATE_IN_BACKGROUND - /* Start the EPG updater thread. */ - this->epg_updater_stop = 0; - if (pthread_create(&this->epg_updater_thread, NULL, - epg_data_updater, this) != 0) { - xprintf( - this->class->xine, XINE_VERBOSITY_LOG, - _("input_dvb: cannot create EPG updater thread\n")); - return 0; - + if (this->dvb_gui_enabled) { + /* Start the EPG updater thread. */ + this->epg_updater_stop = 0; + if (pthread_create(&this->epg_updater_thread, NULL, + epg_data_updater, this) != 0) { + xprintf( + this->class->xine, XINE_VERBOSITY_LOG, + _("input_dvb: cannot create EPG updater thread\n")); + return 0; + } } #endif /* @@ -3260,6 +3297,19 @@ static void *init_class (xine_t *xine, v _("If enabled xine will remember and switch to this channel. "), 21, NULL, NULL); + config->register_num(config, "media.dvb.tuning_timeout", + 0, + _("Number of seconds until tuning times out."), + _("Leave at 0 means try forever. " + "Greater than 0 means wait that many seconds to get a lock. Minimum is 5 seconds."), + 0, NULL, (void *) this); + + /* set to 0 to turn off the GUI built into this input plugin */ + config->register_bool(config, "media.dvb.gui_enabled", + 1, + _("Enable the DVB GUI"), + _("Enable the DVB GUI, mouse controlled recording and channel switching."), + 21, NULL, NULL); config->register_num(config, "media.dvb.adapter", 0, diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_dvd.c --- a/src/input/input_dvd.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_dvd.c Thu Jun 21 23:28:29 2007 +0100 @@ -1482,19 +1482,21 @@ static int dvd_plugin_open (input_plugin dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen; dvd_input_class_t *class = (dvd_input_class_t*)this_gen->input_class; - char *locator; + char *locator, *locator_orig; char *title_part; xine_cfg_entry_t region_entry, lang_entry, cfg_entry; trace_print("Called\n"); /* we already checked the "dvd:/" MRL before */ - locator = this->mrl + (sizeof("dvd:") - 1); + locator_orig = locator = strdup (this->mrl + (sizeof("dvd:") - 1)); /* FIXME: call a generic xine-lib MRL parser here to pre-parse * the MRL for ?title=<title>&part=<part> stuff and to expand * escaped characters properly */ - + + _x_mrl_unescape (locator); + this->mode = dvd_parse_mrl(this, &locator, &title_part); if (this->mode == MODE_FAIL) { @@ -1503,8 +1505,11 @@ static int dvd_plugin_open (input_plugin _x_message(this->stream, XINE_MSG_READ_ERROR, /* FIXME: see FIXME in dvd_parse_try_open() */ (strlen(locator) && !(locator[0] == '/' && locator[1] == '\0')) ? locator : class->dvd_device, NULL); + free (locator_orig); return 0; } + + free (locator_orig); dvdnav_get_title_string(this->dvdnav, &this->dvd_name); if(this->dvd_name) diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_file.c --- a/src/input/input_file.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_file.c Thu Jun 21 23:28:29 2007 +0100 @@ -327,31 +327,8 @@ static void file_plugin_dispose (input_p } static char *decode_uri (char *uri) { - - int len = strlen (uri); - int i; - uri = strdup(uri); - - for (i=0; i<len; i++) { - - if ( (uri[i]=='%') && (i<(len-2)) ) { - - int c; - - if ( sscanf (&uri[i+1], "%02x", &c) == 1) { - - uri[i]= (char) c; - - memmove (uri+i+1, uri+i+3, len-i-3); - - len-=2; - } - } - } - - uri[len] = 0; - + _x_mrl_unescape (uri); return uri; } diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_http.c --- a/src/input/input_http.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_http.c Thu Jun 21 23:28:29 2007 +0100 @@ -668,6 +668,7 @@ static int http_plugin_open (input_plugi int buflen; int use_proxy; int proxyport; + int mpegurl_redirect = 0; use_proxy = this_class->proxyhost && strlen(this_class->proxyhost); @@ -899,6 +900,15 @@ static int http_plugin_open (input_plugi if (!strncasecmp (this->buf, "WWW-Authenticate: ", 18)) strcpy (this->preview, this->buf + 18); + { + static const char mpegurl_ct_str[] = "Content-Type: audio/x-mpegurl"; + static const size_t mpegurl_ct_size = sizeof(mpegurl_ct_str)-1; + if (!strncasecmp(this->buf, mpegurl_ct_str, mpegurl_ct_size)) { + lprintf("Opening an audio/x-mpegurl file, late redirect."); + + mpegurl_redirect = 1; + } + } /* Icecast / ShoutCast Stuff */ if (!strncasecmp(this->buf, TAG_ICY_NAME, sizeof(TAG_ICY_NAME) - 1)) { @@ -967,6 +977,30 @@ static int http_plugin_open (input_plugi _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED, this->mrl, *this->preview ? this->preview : NULL, NULL); + if ( mpegurl_redirect ) { + char buf[4096] = { 0, }; + char *newline = NULL; + + http_plugin_read_int(this, buf, 4095); + newline = strstr(buf, "\r\n"); + + /* If the newline can't be found, either the 4K buffer is too small, or + * more likely something is fuzzy. + */ + if ( newline ) { + char *href; + + *newline = '\0'; + + lprintf("mpegurl pointing to %s\n", buf); + + href = _x_canonicalise_url (this->mrl, buf); + free(this->mrl); + this->mrl = href; + return http_plugin_open(this_gen); + } + } + /* * fill preview buffer */ diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_rtp.c --- a/src/input/input_rtp.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_rtp.c Thu Jun 21 23:28:29 2007 +0100 @@ -79,6 +79,7 @@ #include <sys/time.h> #include <stdlib.h> #include <net/if.h> +#include <sys/select.h> #if defined (__SVR4) && defined (__sun) # include <sys/sockio.h> @@ -125,11 +126,9 @@ typedef struct { int fh; unsigned char *buffer; /* circular buffer */ - unsigned char *buffer_tail; /* tail pointer used by reader */ - unsigned char *buffer_head; /* head pointer used by writer */ + unsigned char *buffer_get_ptr; /* get pointer used by reader */ + unsigned char *buffer_put_ptr; /* put pointer used by writer */ long buffer_count; /* number of bytes in the buffer */ - pthread_mutex_t buffer_mutex; /* only used for locking the - * the buffer count variable */ unsigned char packet_buffer[65536]; @@ -143,13 +142,12 @@ typedef struct { char preview[MAX_PREVIEW_SIZE]; int preview_size; + int preview_read_done; /* boolean true after attempt to read input stream for preview */ nbc_t *nbc; - pthread_mutex_t writer_mut; + pthread_mutex_t buffer_ring_mut; pthread_cond_t writer_cond; - - pthread_mutex_t reader_mut; pthread_cond_t reader_cond; } rtp_input_plugin_t; @@ -198,7 +196,7 @@ static int host_connect_attempt(struct i /* Try to increase receive buffer to 1MB to avoid dropping packets */ - optval = 1024 * 1024; + optval = BUFFER_SIZE; if ((setsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, sizeof(optval))) < 0) { LOG_MSG(xine, _("setsockopt(SO_RCVBUF): %s.\n"), strerror(errno)); @@ -298,6 +296,7 @@ static void * input_plugin_read_loop(voi rtp_input_plugin_t *this = (rtp_input_plugin_t *) arg; unsigned char *data; long length; + fd_set read_fds; while (1) { @@ -308,8 +307,28 @@ static void * input_plugin_read_loop(voi */ pthread_testcancel(); - length = recv(this->fh, this->packet_buffer, - sizeof(this->packet_buffer), 0); + { + struct timeval recv_timeout; + int rc; + + recv_timeout.tv_sec = 2; + recv_timeout.tv_usec = 0; + + FD_ZERO( &read_fds ); + FD_SET( this->fh, &read_fds ); + + /* wait for a packet to arrive - but do not hang! */ + rc = select( this->fh+1, &read_fds, NULL, NULL, &recv_timeout ); + if( rc > 0 ) + { + length = recv(this->fh, this->packet_buffer, + sizeof(this->packet_buffer), 0); + } + else if( rc == 0 ) + length = 0; + else + length = -1; + } pthread_testcancel(); if (length < 0) { @@ -362,28 +381,31 @@ static void * input_plugin_read_loop(voi } /* insert data into cyclic buffer */ - while (length > 0) { - - /* work with a copy of buffer count, while the variable can - * be updated by the reader - */ - - long buffer_count = this->buffer_count; - long n; + if (length > 0) { /* * if the buffer is full, wait for the reader * to signal */ - if(buffer_count >= BUFFER_SIZE) { - pthread_mutex_lock(&this->writer_mut); - pthread_cond_wait(&this->writer_cond, &this->writer_mut); - pthread_mutex_unlock(&this->writer_mut); - /* update the buffer count again */ - buffer_count = this->buffer_count; - } - + pthread_mutex_lock(&this->buffer_ring_mut); + /* wait for enough space to write the whole of the recv'ed data */ + while( (BUFFER_SIZE - this->buffer_count) < length ) + { + struct timeval tv; + struct timespec timeout; + + gettimeofday(&tv, NULL); + + timeout.tv_nsec = tv.tv_usec * 1000; + timeout.tv_sec = tv.tv_sec + 2; + [... 93 lines omitted ...] + if(pthread_cond_timedwait(&this->reader_cond, &this->buffer_ring_mut, &timeout) != 0) { /* we timed out, no data available */ - pthread_mutex_unlock(&this->reader_mut); + pthread_mutex_unlock(&this->buffer_ring_mut); return copied; } - pthread_mutex_unlock(&this->reader_mut); - /* update the local buffer count variable again */ - buffer_count = this->buffer_count; } /* Now determine how many bytes can be read. If the buffer @@ -479,43 +485,60 @@ static off_t rtp_plugin_read (input_plug * update the buffer count. Finally read the second piece * from the base to the remaining count */ - if(length > buffer_count) { - n = buffer_count; + if(length > this->buffer_count) { + n = this->buffer_count; } else { n = length; } - if(((this->buffer_tail - this->buffer) + n) > BUFFER_SIZE) { - n = BUFFER_SIZE - (this->buffer_tail - this->buffer); + if(((this->buffer_get_ptr - this->buffer) + n) > BUFFER_SIZE) { + n = BUFFER_SIZE - (this->buffer_get_ptr - this->buffer); } /* the actual read */ - memcpy(buf, this->buffer_tail, n); + memcpy(buf, this->buffer_get_ptr, n); buf += n; copied += n; length -= n; /* update the tail pointer, watch for wrap arounds */ - this->buffer_tail += n; - if(this->buffer_tail - this->buffer >= BUFFER_SIZE) - this->buffer_tail = this->buffer; + this->buffer_get_ptr += n; + if(this->buffer_get_ptr - this->buffer >= BUFFER_SIZE) + this->buffer_get_ptr = this->buffer; - /* lock the buffer, for updating the count */ - pthread_mutex_lock(&this->buffer_mutex); this->buffer_count -= n; - pthread_mutex_unlock(&this->buffer_mutex); /* signal the writer that there's space in the buffer again */ - pthread_mutex_lock(&this->writer_mut); pthread_cond_signal(&this->writer_cond); - pthread_mutex_unlock(&this->writer_mut); + pthread_mutex_unlock(&this->buffer_ring_mut); } this->curpos += copied; return copied; +} + +static buf_element_t *rtp_plugin_read_block (input_plugin_t *this_gen, + fifo_buffer_t *fifo, off_t todo) { + buf_element_t *buf = fifo->buffer_pool_alloc (fifo); + int total_bytes; + + + buf->content = buf->mem; + buf->type = BUF_DEMUX_BLOCK; + + total_bytes = rtp_plugin_read (this_gen, buf->content, todo); + + if (total_bytes != todo) { + buf->free_buffer (buf); + return NULL; + } + + buf->size = total_bytes; + + return buf; } /* @@ -585,9 +608,11 @@ static int rtp_plugin_get_optional_data */ if (data_type == INPUT_OPTIONAL_DATA_PREVIEW) { - if (this->preview_size == 0) { + if (!this->preview_read_done) { this->preview_size = rtp_plugin_read(this_gen, this->preview, MAX_PREVIEW_SIZE); lprintf("Preview data length = %d\n", this->preview_size); + + this->preview_read_done = 1; } memcpy(data, this->preview, this->preview_size); return this->preview_size; @@ -706,23 +731,21 @@ static input_plugin_t *rtp_class_get_ins if (iptr) this->interface = iptr; - pthread_mutex_init(&this->buffer_mutex, NULL); - pthread_mutex_init(&this->reader_mut, NULL); - pthread_mutex_init(&this->writer_mut, NULL); + pthread_mutex_init(&this->buffer_ring_mut, NULL); pthread_cond_init(&this->reader_cond, NULL); pthread_cond_init(&this->writer_cond, NULL); this->buffer = malloc(BUFFER_SIZE); - this->buffer_head = this->buffer; - this->buffer_tail = this->buffer; + this->buffer_put_ptr = this->buffer; + this->buffer_get_ptr = this->buffer; this->buffer_count = 0; this->curpos = 0; this->input_plugin.open = rtp_plugin_open; this->input_plugin.get_capabilities = rtp_plugin_get_capabilities; this->input_plugin.read = rtp_plugin_read; - this->input_plugin.read_block = NULL; + this->input_plugin.read_block = rtp_plugin_read_block; this->input_plugin.seek = rtp_plugin_seek; this->input_plugin.get_current_pos = rtp_plugin_get_current_pos; this->input_plugin.get_length = rtp_plugin_get_length; diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/input_v4l.c --- a/src/input/input_v4l.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/input_v4l.c Thu Jun 21 23:28:29 2007 +0100 @@ -62,11 +62,31 @@ #define XINE_ENABLE_EXPERIMENTAL_FEATURES /********** logging **********/ -#define LOG_MODULE "input_v4l" +/* #define LOG_MODULE "input_v4l" */ #define LOG_VERBOSE /* #define LOG */ + +#ifdef LOG +#define LOG_MODULE log_line_prefix() + +static char *log_line_prefix() +{ + static int print_timestamp = 1; + struct timeval now; + struct tm now_tm; + char buffer[64]; + + if( print_timestamp ) { + gettimeofday( &now, NULL ); + localtime_r( &now.tv_sec, &now_tm ); + strftime( buffer, sizeof( buffer ), "%Y-%m-%d %H:%M:%S", &now_tm ); + printf( "%s.%6.6ld: ", buffer, now.tv_usec ); + } + return "input_v4l"; +} +#endif #include "xine_internal.h" #include "xineutils.h" @@ -89,6 +109,9 @@ static const resolution_t resolutions[] { 320, 240 }, { 160, 120 } }; + +static char *tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL }; +static int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM }; #define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0])) #define RADIO_DEV "/dev/v4l/radio0" @@ -547,7 +570,8 @@ static int set_frequency(v4l_input_plugi ret = ioctl(fd, VIDIOCSFREQ, &this->calc_frequency); - lprintf("IOCTL set frequency (%ld) returned: %d\n", frequency, ret); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + "input_v4l: set frequency (%ld) returned: %d\n", frequency, ret); } else { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "input_v4l: No frequency given. Expected syntax: v4l:/tuner/frequency\n" @@ -624,6 +648,7 @@ static int search_by_channel(v4l_input_p { int ret = 0; int fd = 0; + cfg_entry_t *tv_standard_entry; lprintf("input_source: %s\n", input_source); @@ -659,11 +684,17 @@ static int search_by_channel(v4l_input_p return -1; } + tv_standard_entry = this->stream->xine->config->lookup_entry(this->stream->xine->config, + "media.video4linux.tv_standard"); this->tuner_name = input_source; - ret = ioctl(fd, VIDIOCSCHAN, &this->input); + this->video_channel.norm = tv_standard_values[ tv_standard_entry->num_value ]; + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + "input_v4l: TV Standard configured as STD %s (%d)\n", + tv_standard_names[ tv_standard_entry->num_value ], this->video_channel.norm ); + ret = ioctl(fd, VIDIOCSCHAN, &this->video_channel); lprintf("(%d) Set channel to %d\n", ret, this->input); - + /* FIXME: Don't assume tuner 0 ? */ this->tuner = 0; @@ -819,7 +850,7 @@ static int open_video_capture_device(v4l } lprintf("Device opened, tv %d\n", this->video_fd); - + /* figure out the resolution */ for (j = 0; j < NUM_RESOLUTIONS; j++) { @@ -1911,6 +1942,12 @@ static void *init_video_class (xine_t *x _("The path to your Video4Linux video device."), 10, NULL, NULL); + config->register_enum (config, "media.video4linux.tv_standard", 0, + tv_standard_names, _("v4l TV standard"), + _("Selects the TV standard of the input signals. " + "Either: PAL, NTSC and SECAM. "), 20, NULL, NULL); + + return this; } diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/input/vcd/xineplug_inp_vcd.c --- a/src/input/vcd/xineplug_inp_vcd.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/input/vcd/xineplug_inp_vcd.c Thu Jun 21 23:28:29 2007 +0100 @@ -502,14 +502,16 @@ vcd_parse_mrl(/*in*/ const char *default itemid->type = (vcdinfo_item_enum_t) auto_type; *used_default = false; - if ( NULL != mrl && !strncasecmp(mrl, MRL_PREFIX, MRL_PREFIX_LEN) ) - p = &mrl[MRL_PREFIX_LEN]; - else { + if ( NULL == mrl || strncasecmp(mrl, MRL_PREFIX, MRL_PREFIX_LEN) ) return false; - } - - count = sscanf (p, "%1024[^@]@%1[EePpSsTt]%u", - device_str, type_str, &num); + p = &mrl[MRL_PREFIX_LEN - 2]; + while (*p == '/') + ++p; + + device_str[0] = '/'; + device_str[1] = 0; + count = sscanf (p, "%1023[^@]@%1[EePpSsTt]%u", + device_str + 1, type_str, &num); itemid->num = num; switch (count) { @@ -522,11 +524,18 @@ vcd_parse_mrl(/*in*/ const char *default itemid->num = num; if (1==count) { type_str[0] = 'T'; + if (default_vcd_device) + strncpy(device_str, default_vcd_device, MAX_DEVICE_LEN); + else + *device_str = 0; } - + else + _x_mrl_unescape (device_str); break; } - + case 2 ... 9: + _x_mrl_unescape (device_str); + case 0: case EOF: { @@ -999,7 +1008,7 @@ vcd_plugin_get_mrl (input_plugin_t *this return human readable (verbose = 1 line) description for this plugin */ -static char * +static const char * vcd_class_get_description (input_class_t *this_gen) { dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n"); diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/libffmpeg/ff_audio_decoder.c --- a/src/libffmpeg/ff_audio_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/libffmpeg/ff_audio_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -273,7 +273,7 @@ static void ff_audio_decode_data (audio_ } if (!this->output_open) { - this->output_open = this->stream->audio_out->open(this->stream->audio_out, + this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream, this->audio_bits, this->audio_sample_rate, _x_ao_channels2mode(this->audio_channels)); } diff -r de1f9dcd0565c40ea0e198e7084b574e930128e2 -r 3316deabaa0abacebdb0eac0f3df5cdf0b2583ca src/libffmpeg/ff_dvaudio_decoder.c --- a/src/libffmpeg/ff_dvaudio_decoder.c Thu Aug 30 15:20:19 2007 +0100 +++ b/src/libffmpeg/ff_dvaudio_decoder.c Thu Jun 21 23:28:29 2007 +0100 @@ -265,7 +265,7 @@ static void dvaudio_decode_data (audio_d if (this->decoder_ok && !(buf->decoder_flags & (BUF_FLAG_HEADER|BUF_FLAG_SPECIAL))) { if (!this->output_open) { - this->output_open = this->stream->audio_out->open(this->stream->audio_out, + this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream, this->audio_bits, this->audio_sample_rate, _x_ao_channels2mode(this->audio_channels)); } diff -r de1f9dcd0565c40ea0e198e7084b574e9301... [truncated message content] |