From dbacda8274e2d76b0ea42f90b94353b672fa9343 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 13 Feb 2005 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.21=20-=20Fixed=20cDvbDevice::SetAudioTrac?= =?UTF-8?q?kDevice()=20to=20avoid=20a=20blank=20screen=20after=20switching?= =?UTF-8?q?=20=20=20back=20to=20live=20mode=20if=20a=20recording=20is=20cu?= =?UTF-8?q?rrently=20active=20on=20the=20primary=20device.=20-=20Fixed=20a?= =?UTF-8?q?=20possible=20freeze=20in=20pause=20mode=20in=20case=20a=20devi?= =?UTF-8?q?ce's=20PlayPesPacket()=20function=20=20=20permanently=20returns?= =?UTF-8?q?=200=20(thanks=20to=20Reinhard=20Nissl=20and=20Olaf=20Titz).=20?= =?UTF-8?q?-=20Completed=20the=20Finnish=20OSD=20texts=20(thanks=20to=20Ro?= =?UTF-8?q?lf=20Ahrenberg).=20-=20Restricted=20the=20"setting=20audio=20tr?= =?UTF-8?q?ack"=20log=20message=20to=20automatic=20changes=20during=20repl?= =?UTF-8?q?ay.=20-=20Fixed=20handling=20Transfer=20Mode=20for=20radio=20ch?= =?UTF-8?q?annels=20(thanks=20to=20Andreas=20Regel=20for=20=20=20reporting?= =?UTF-8?q?=20this=20one).=20-=20Fixed=20handling=20symbolic=20links=20in?= =?UTF-8?q?=20cRecordings::ScanVideoDir()=20(thanks=20to=20Stefan=20=20=20?= =?UTF-8?q?Huelswitt).=20-=20Completed=20the=20Danish=20OSD=20texts=20(tha?= =?UTF-8?q?nks=20to=20Mogens=20Elneff).=20-=20Forcing=20a=20new=20resync?= =?UTF-8?q?=20after=20a=20call=20to=20cRemux::Clear()=20(suggested=20by=20?= =?UTF-8?q?Marco=20Schl=C3=BC=C3=9Fler).=20-=20The=20cAudio::Play()=20func?= =?UTF-8?q?tion=20now=20has=20an=20additional=20parameter=20'uchar=20Id'?= =?UTF-8?q?=20which=20tells=20=20=20the=20function=20the=20substream=20id?= =?UTF-8?q?=20of=20the=20given=20audio=20packet,=20so=20that=20a=20plugin?= =?UTF-8?q?=20can=20=20=20take=20the=20right=20action=20for=20the=20variou?= =?UTF-8?q?s=20kinds=20if=20audio=20data=20-=20which=20now=20also=20includ?= =?UTF-8?q?es=20=20=20"normal"=20audio=20with=20ids=200xC0...0xDF=20(based?= =?UTF-8?q?=20on=20suggestions=20by=20Werner=20Fink=20and=20Macro=20=20=20?= =?UTF-8?q?Schl=C3=BC=C3=9Fler).=20-=20Removed=20the=20"Cleared/PlayPes(NU?= =?UTF-8?q?LL,=200)"=20handling=20from=20cTransfer::Action(),=20since=20th?= =?UTF-8?q?is=20=20=20is=20now=20done=20when=20attaching=20the=20player=20?= =?UTF-8?q?to=20the=20device=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler)?= =?UTF-8?q?.=20-=20Making=20sure=20the=20buffer=20reserve=20in=20cTransfer?= =?UTF-8?q?::Action()=20is=20re-established=20after=20=20=20clearing=20the?= =?UTF-8?q?=20buffer.=20-=20Added=20DeviceClrAvailableTracks()=20and=20Dev?= =?UTF-8?q?iceSetCurrentAudioTrack()=20to=20cPlayer=20=20=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fixed=20a=20typo=20in=20?= =?UTF-8?q?detecting=20UTF-8=20(thanks=20to=20Reinhard=20Nissl).=20-=20Now?= =?UTF-8?q?=20using=20twice=20the=20buffer=20reserve=20in=20cTransfer=20if?= =?UTF-8?q?=20the=20primary=20DVB=20card=20is=20an=20=20=20unmodified=20ve?= =?UTF-8?q?rsion=20with=20only=202MB=20of=20SDRAM,=20to=20avoid=20audio=20?= =?UTF-8?q?stuttering=20when=20=20=20playing=20Dolby=20Digital=20over=20th?= =?UTF-8?q?e=20DVB=20card=20(thanks=20to=20Christian=20Jacobsen=20and=20Ch?= =?UTF-8?q?ad=20=20=20Flynt=20for=20suggestions=20and=20experiments=20in?= =?UTF-8?q?=20that=20area).=20-=20Making=20sure=20the=20first=20audio=20pa?= =?UTF-8?q?cket=20is=20not=20dropped=20when=20switching=20to=20"pre=201.3.?= =?UTF-8?q?19=20=20=20Dolby=20Digital=20compatibility=20mode".=20-=20The?= =?UTF-8?q?=20'plugins-clean'=20target=20of=20the=20Makefile=20now=20only?= =?UTF-8?q?=20deletes=20the=20actual=20plugin=20=20=20library=20files=20fr?= =?UTF-8?q?om=20this=20version=20of=20VDR=20(suggested=20by=20Andreas=20Br?= =?UTF-8?q?achold).=20-=20Added=20a=20missing=20'resultSkipped=20=3D=200'?= =?UTF-8?q?=20to=20cRemux::Clear()=20(thanks=20to=20Marco=20Schl=C3=BC?= =?UTF-8?q?=C3=9Fler=20=20=20for=20reporting=20this=20one).=20-=20The=20ne?= =?UTF-8?q?w=20function=20cDvbDevice::SetTransferModeForDolbyDigital()=20c?= =?UTF-8?q?an=20be=20used=20by=20=20=20plugins=20that=20implement=20Dolby?= =?UTF-8?q?=20Digital=20output=20and=20thus=20want=20to=20prevent=20the=20?= =?UTF-8?q?cDvbDevice=20=20=20from=20starting=20Transfer=20Mode=20in=20ord?= =?UTF-8?q?er=20to=20replay=20DD=20over=20the=20DVB=20device.=20-=20Added?= =?UTF-8?q?=20missing=20reset=20of=20the=20'repacker'=20to=20cTS2PES::Clea?= =?UTF-8?q?r()=20(thanks=20to=20Marco=20=20=20Schl=C3=BC=C3=9Fler=20for=20?= =?UTF-8?q?reporting=20this=20one).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTORS | 23 ++++++++++++++++++++++- HISTORY | 42 ++++++++++++++++++++++++++++++++++++++++++ INSTALL | 2 +- Makefile | 10 +++++++--- PLUGINS.html | 41 +++++++++++++++++++++-------------------- audio.c | 35 +++++++++++++++++------------------ audio.h | 23 ++++++++++++----------- channels.conf | 10 +++++----- config.h | 6 +++--- device.c | 23 ++++++++++++++++------- dvbdevice.c | 20 +++++++++++++++----- dvbdevice.h | 5 ++++- dvbosd.c | 9 ++++++++- i18n.c | 6 +++--- player.h | 4 +++- recording.c | 7 ++++--- remux.c | 10 ++++++++-- tools.h | 4 ++-- transfer.c | 38 +++++++++++++++++++++++--------------- vdr.c | 6 +++--- 20 files changed, 219 insertions(+), 105 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0c29e35..94258a4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -192,6 +192,7 @@ Stefan Huelswitt for fixing a possible race condition in cDevice::Action() and cTSBuffer::Action() for reporting several memory leaks that were introduced through the use of cString for adding MPEG1 replay capability to cPesAssembler + for fixing handling symbolic links in cRecordings::ScanVideoDir() Ulrich Röder for pointing out that there are channels that have a symbol rate higher than 27500 @@ -272,6 +273,7 @@ Werner Fink recordings can be triggered in the default branch for pointing out that pesAssembler->Reset() needs to be called between subsequent Transfer Modes + for suggestions that led to the addition of the 'Id' parameter to cAudio::Play(). Rolf Hakenes for providing 'libdtv' and adapting the EIT mechanisms to it @@ -789,10 +791,12 @@ Christoph Friederich for reporting a bug in deleting the last recording in the "Recordings" menu, which started pausing live video -Andreas Brachold +Andreas Brachold for his support in keeping 'channels.conf.terr' up to date for fixing 'newplugin' and libsi/Makefile to use the compiler defined in $(CXX) for generating file dependencies + for suggesting that the 'plugins-clean' target of the Makefile should only delete + the actual plugin library files from this version of VDR Manuel Hartl for suggesting to extend the logging info when starting/stopping timers @@ -805,6 +809,7 @@ Christian Jacobsen for making the LIRC interface skip keys that come in too fast for reporting a problem in handling the '-E' options in version 1.3.18 for reporting a problem in case a station defines all 32 audio PIDs + for suggestions and experiments regarding the buffer reserve in cTransfer Andreas Mair for reporting a short display of the main menu if a plugin displays its own OSD and @@ -925,6 +930,9 @@ Reinhard Nissl for extending some buffer sizes to allow handling HDTV streams for adding substream handling to cDolbyRepacker for modifying cDolbyRepacker to make sure PES packets don't exceed the requested length + for fixing a possible freeze in pause mode in case a device's PlayPesPacket() + function permanently returns 0 + for fixing a typo in detecting UTF-8 Richard Robson for reporting freezing replay if a timer starts while in Transfer Mode from the @@ -1042,6 +1050,7 @@ Andreas Regel video directory is empty for pointing out a missing call to cStatus::MsgOsdtatusMessage(NULL) in cSkins::Message() + for reporting a problem in handling Transfer Mode for radio channels Thomas Bergwinkl for fixing the validity check for channel IDs, because some providers use TIDs @@ -1131,6 +1140,13 @@ Marco Schl for pointing out that PlayPes(NULL, 0) needs to be called in cTransfer::Action() when clearing the transfer buffer to avoid overflows for adding CMD_SPU_CHG_COLCON to cDvbSpuDecoder::setTime() + for suggesting to force a new resync after a call to cRemux::Clear() + for suggestions that led to the addition of the 'Id' parameter to cAudio::Play(). + for removing the "Cleared/PlayPes(NULL, 0)" handling from cTransfer::Action(), since + this is now done when attaching the player to the device + for adding DeviceClrAvailableTracks() and DeviceSetCurrentAudioTrack() to cPlayer + for reporting a missing 'resultSkipped = 0' in cRemux::Clear() + for reporting a missing reset of the 'repacker' in cTS2PES::Clear() Jürgen Schmitz for reporting a bug in displaying the current channel when switching via the SVDRP @@ -1215,6 +1231,8 @@ Dino Ravnic Olaf Titz for fixing some typos in the Makefile's 'font' target + for reporting a problem and some advice in fixing a possible freeze in pause mode + in case a device's PlayPesPacket() function permanently returns 0 Darren Salt for pointing out that the '-' and 'ö' characters need to be escaped in the man @@ -1250,3 +1268,6 @@ Rolf Groppe Wolfgang Rohdewald for pointing out that primaryDevice = NULL should be done before deleting the devices in cDevice::Shutdown() + +Chad Flynt + for suggestions and experiments regarding the buffer reserve in cTransfer diff --git a/HISTORY b/HISTORY index 2beb808..41b36eb 100644 --- a/HISTORY +++ b/HISTORY @@ -3373,3 +3373,45 @@ Video Disk Recorder Revision History residual data in replay and Transfer Mode (thanks to Werner Fink for pointing this out). - Added MPEG1 replay capability to cPesAssembler (thanks to Stefan Huelswitt). + +2005-02-13: Version 1.3.21 + +- Fixed cDvbDevice::SetAudioTrackDevice() to avoid a blank screen after switching + back to live mode if a recording is currently active on the primary device. +- Fixed a possible freeze in pause mode in case a device's PlayPesPacket() function + permanently returns 0 (thanks to Reinhard Nissl and Olaf Titz). +- Completed the Finnish OSD texts (thanks to Rolf Ahrenberg). +- Restricted the "setting audio track" log message to automatic changes during replay. +- Fixed handling Transfer Mode for radio channels (thanks to Andreas Regel for + reporting this one). +- Fixed handling symbolic links in cRecordings::ScanVideoDir() (thanks to Stefan + Huelswitt). +- Completed the Danish OSD texts (thanks to Mogens Elneff). +- Forcing a new resync after a call to cRemux::Clear() (suggested by Marco Schlüßler). +- The cAudio::Play() function now has an additional parameter 'uchar Id' which tells + the function the substream id of the given audio packet, so that a plugin can + take the right action for the various kinds if audio data - which now also includes + "normal" audio with ids 0xC0...0xDF (based on suggestions by Werner Fink and Macro + Schlüßler). +- Removed the "Cleared/PlayPes(NULL, 0)" handling from cTransfer::Action(), since this + is now done when attaching the player to the device (thanks to Marco Schlüßler). +- Making sure the buffer reserve in cTransfer::Action() is re-established after + clearing the buffer. +- Added DeviceClrAvailableTracks() and DeviceSetCurrentAudioTrack() to cPlayer + (thanks to Marco Schlüßler). +- Fixed a typo in detecting UTF-8 (thanks to Reinhard Nissl). +- Now using twice the buffer reserve in cTransfer if the primary DVB card is an + unmodified version with only 2MB of SDRAM, to avoid audio stuttering when + playing Dolby Digital over the DVB card (thanks to Christian Jacobsen and Chad + Flynt for suggestions and experiments in that area). +- Making sure the first audio packet is not dropped when switching to "pre 1.3.19 + Dolby Digital compatibility mode". +- The 'plugins-clean' target of the Makefile now only deletes the actual plugin + library files from this version of VDR (suggested by Andreas Brachold). +- Added a missing 'resultSkipped = 0' to cRemux::Clear() (thanks to Marco Schlüßler + for reporting this one). +- The new function cDvbDevice::SetTransferModeForDolbyDigital() can be used by + plugins that implement Dolby Digital output and thus want to prevent the cDvbDevice + from starting Transfer Mode in order to replay DD over the DVB device. +- Added missing reset of the 'repacker' to cTS2PES::Clear() (thanks to Marco + Schlüßler for reporting this one). diff --git a/INSTALL b/INSTALL index f054d7a..df57170 100644 --- a/INSTALL +++ b/INSTALL @@ -268,7 +268,7 @@ name you use with '-v' is a clean and absolute path name (no '..' or multiple slashes). Note that the file system need not be 64-bit proof, since the 'vdr' -program splits video files into chunks of about 1GB. You should use +program splits video files into chunks of about 2GB. You should use a disk with several gigabytes of free space. One GB can store roughly half an hour of video data. diff --git a/Makefile b/Makefile index f70a2e9..59e7e78 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 1.73 2004/12/18 13:39:19 kls Exp $ +# $Id: Makefile 1.74 2005/02/13 10:13:45 kls Exp $ .DELETE_ON_ERROR: @@ -71,6 +71,10 @@ DEFINES += -D_GNU_SOURCE DEFINES += -DVIDEODIR=\"$(VIDEODIR)\" DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\" +# The version number of VDR (taken from VDR's "config.h"): + +VDRVERSION = $(shell grep 'define VDRVERSION ' config.h | awk '{ print $$3 }' | sed -e 's/"//g') + ifdef VFAT # for people who want their video directory on a VFAT partition DEFINES += -DVFAT @@ -166,7 +170,7 @@ plugins: include-dir plugins-clean: @for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do $(MAKE) -C "$(PLUGINDIR)/src/$$i" clean; done - @-rm -f $(PLUGINLIBDIR)/* + @-rm -f $(PLUGINLIBDIR)/libvdr-*.so.$(VDRVERSION) # Install the files: @@ -183,7 +187,7 @@ install: srcdoc: @cp $(DOXYFILE) $(DOXYFILE).tmp - @echo PROJECT_NUMBER = `grep VDRVERSION config.h | awk '{ print $$3 }'` >> $(DOXYFILE).tmp + @echo PROJECT_NUMBER = $(VDRVERSION) >> $(DOXYFILE).tmp $(DOXYGEN) $(DOXYFILE).tmp @rm $(DOXYFILE).tmp diff --git a/PLUGINS.html b/PLUGINS.html index df6d0fa..67b96d9 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -14,18 +14,18 @@ Copyright © 2004 Klaus Schmidinger
www.cadsoft.de/vdr

-
  -Important modifications introduced in version 1.3.8 are marked like this. -
-
  +
  Important modifications introduced in version 1.3.18 are marked like this.
-
  +
  Important modifications introduced in version 1.3.19 are marked like this.
-
  +
  Important modifications introduced in version 1.3.20 are marked like this.
+
  +Important modifications introduced in version 1.3.21 are marked like this. +

VDR provides an easy to use plugin interface that allows additional functionality to be added to the program by implementing a dynamically loadable library file. @@ -58,7 +58,7 @@ structures and allows it to hook itself into specific areas to perform special a

  • Command line arguments
  • Command line help
  • Getting started -
      +
     
  • Shutting down
  • Main menu entry @@ -81,7 +81,9 @@ structures and allows it to hook itself into specific areas to perform special a
  • Skins
  • Themes
  • Devices -
  • Dolby Digital +
      +
  • Audio +
  • Remote Control @@ -306,7 +308,7 @@ since VDR, for instance, has to create the plugin objects in order to get their command line help - and after that immediately destroys them again.

    The destructor has to clean up any data created by the plugin. -
      +
      Any threads the plugin may have created shall be stopped in the Stop() function.
    @@ -504,7 +506,7 @@ VDR to exit. If the plugin doesn't implement any background functionality or internationalized texts, it doesn't need to implement either of these functions. -
      +
     

    Shutting down

    Stop it, right there!

    @@ -1044,7 +1046,7 @@ public: Take a look at the files player.h and dvbplayer.c to see how VDR implements its own player for the VDR recordings.

    -
      +
      To play the actual data, the player needs to call its member function

    @@ -1067,7 +1069,7 @@ bool DevicePoll(cPoller &Poller, int TimeoutMs = 0);
     
     to determine whether the device is ready for further data.
     

    -
      +
      By default all audio track handling is done by the device a player is attached to. If the player can provide more than a single audio track, and has special @@ -1204,7 +1206,7 @@ public: }; cMyReceiver::cMyReceiver(int Pid) -
      +
      :cReceiver(0, -1, Pid)
    { @@ -1382,7 +1384,7 @@ public: virtual cSkinDisplayMenu *DisplayMenu(void); virtual cSkinDisplayReplay *DisplayReplay(bool ModeOnly); virtual cSkinDisplayVolume *DisplayVolume(void); -
      +
      virtual cSkinDisplayMessage *DisplayTrack(int NumTracks, const char * const *Tracks);
    virtual cSkinDisplayMessage *DisplayMessage(void); @@ -1404,7 +1406,6 @@ new cMySkin; in the Start() function of your plugin. Do not delete this object, it will be automatically deleted when the program ends.

    -
      In order to be able to easily identify plugins that implement a skin it is recommended that the name of such a plugin should be @@ -1414,8 +1415,6 @@ skinxyz where xyz is the actual name of the skin. -
    -


    Themes

    Eye of the beholder...

    @@ -1514,7 +1513,7 @@ repectively. If the device can provide more than a single audio track, it can implement the following function to make them available: -
      +
     

     virtual void SetAudioTrackDevice(eTrackType Type);
     virtual int GetAudioChannelDevice(void);
    @@ -1659,7 +1658,7 @@ shut down (delete) all devices when the program terminates. It is therefore
     important that the devices are created on the heap, using the new
     operator!
     
    -

    Dolby Digital

    +

    Audio

    "The stereo effect may only be experienced if stereo equipment is used!"

    @@ -1679,7 +1678,9 @@ private: virtual void Action(void); public: cMyAudio(void); - virtual void Play(const uchar *Data, int Length); +
      + virtual void Play(const uchar *Data, int Length, uchar Id); +
    virtual void Mute(bool On); virtual void Clear(void); }; diff --git a/audio.c b/audio.c index c958256..742c50b 100644 --- a/audio.c +++ b/audio.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: audio.c 1.2 2002/11/03 11:53:34 kls Exp $ + * $Id: audio.c 1.3 2005/02/12 12:40:51 kls Exp $ */ #include "audio.h" @@ -25,10 +25,10 @@ cAudio::~cAudio() cAudios Audios; -void cAudios::PlayAudio(const uchar *Data, int Length) +void cAudios::PlayAudio(const uchar *Data, int Length, uchar Id) { for (cAudio *audio = First(); audio; audio = Next(audio)) - audio->Play(Data, Length); + audio->Play(Data, Length, Id); } void cAudios::MuteAudio(bool On) @@ -56,25 +56,24 @@ cExternalAudio::~cExternalAudio() free(command); } -void cExternalAudio::Play(const uchar *Data, int Length) +void cExternalAudio::Play(const uchar *Data, int Length, uchar Id) { if (command && !mute) { if (pipe || pipe.Open(command, "w")) { - if (Data[0] == 0x00 && Data[1] == 0x00 && Data[2] == 0x01) { - if (Data[3] == 0xBD) { // dolby - //XXX??? int written = Data[8] + (skipAC3bytes ? 13 : 9); // skips the PES header - int written = Data[8] + 9; // skips the PES header - Length -= written; - while (Length > 0) { - int w = fwrite(Data + written, 1, Length, pipe); - if (w < 0) { - LOG_ERROR; - break; - } - Length -= w; - written += w; + if (0x80 <= Id && Id <= 0x87 || Id == 0xBD) { // AC3 + int written = Data[8] + 9; // skips the PES header + if (Id != 0xBD) + written += 4; // skips AC3 bytes + Length -= written; + while (Length > 0) { + int w = fwrite(Data + written, 1, Length, pipe); + if (w < 0) { + LOG_ERROR; + break; } - } + Length -= w; + written += w; + } } } else { diff --git a/audio.h b/audio.h index 565bd97..03ec01d 100644 --- a/audio.h +++ b/audio.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: audio.h 1.2 2002/11/03 11:50:02 kls Exp $ + * $Id: audio.h 1.3 2005/02/12 12:20:19 kls Exp $ */ #ifndef __AUDIO_H @@ -18,21 +18,22 @@ protected: cAudio(void); public: virtual ~cAudio(); - virtual void Play(const uchar *Data, int Length) = 0; - // Plays the given block of audio Data. Must return as soon as possible. - // If the entire block of data can't be processed immediately, it must - // be copied and processed in a separate thread. The Data is always a - // complete PES audio packet. + virtual void Play(const uchar *Data, int Length, uchar Id) = 0; + ///< Plays the given block of audio Data. Must return as soon as possible. + ///< If the entire block of data can't be processed immediately, it must + ///< be copied and processed in a separate thread. The Data is always a + ///< complete PES audio packet. Id indicates the type of audio data this + ///< packet holds. virtual void Mute(bool On) = 0; - // Immediately sets the audio device to be silent (On==true) or to - // normal replay (On==false). + ///< Immediately sets the audio device to be silent (On==true) or to + ///< normal replay (On==false). virtual void Clear(void) = 0; - // Clears all data that might still be awaiting processing. + ///< Clears all data that might still be awaiting processing. }; class cAudios : public cList { public: - void PlayAudio(const uchar *Data, int Length); + void PlayAudio(const uchar *Data, int Length, uchar Id); void MuteAudio(bool On); void ClearAudio(void); }; @@ -47,7 +48,7 @@ private: public: cExternalAudio(const char *Command); virtual ~cExternalAudio(); - virtual void Play(const uchar *Data, int Length); + virtual void Play(const uchar *Data, int Length, uchar Id); virtual void Mute(bool On); virtual void Clear(void); }; diff --git a/channels.conf b/channels.conf index 836e3be..d05e252 100644 --- a/channels.conf +++ b/channels.conf @@ -45,21 +45,21 @@ rbb Berlin;ARD:12109:hC34:S19.2E:27500:601:602=deu:604:0:28206:1:1073:0 :Premiere World PREMIERE START,START;PREMIERE:11797:hC34:S19.2E:27500:255:256=deu:32:1702,1801,1722:8:133:2:0 PREMIERE 1,PREM 1;PREMIERE:11797:hC34:S19.2E:27500:511:512=deu,513=deu;515=deu:32:1722,1702,1801:10:133:2:0 -PREMIERE 2,PREM 2;PREMIERE:11797:hC34:S19.2E:27500:1791:1792=deu,1793=deu;1795=deu:32:1722,1801,1702:11:133:2:0 +PREMIERE 2,PREM 2;PREMIERE:11797:hC34:S19.2E:27500:1791:1792=deu,1793=deu;1795=deu:32:1702,1722,1801:11:133:2:0 PREMIERE 3,PREM 3;PREMIERE:11797:hC34:S19.2E:27500:2303:2304=deu,2305=deu:32:1722,1801,1702:43:133:2:0 PREMIERE 4,PREM 4;PREMIERE:11797:hC34:S19.2E:27500:767:768=deu,769=deu:32:1801,1722,1702:9:133:2:0 -PREMIERE 5,PREM 5;PREMIERE:11797:hC34:S19.2E:27500:1279:1280=deu,1281=deu:32:1801,1722,1702:29:133:2:0 +PREMIERE 5,PREM 5;PREMIERE:11797:hC34:S19.2E:27500:1279:1280=deu,1281=deu:32:1722,1702,1801:29:133:2:0 PREMIERE 6,PREM 6;PREMIERE:11797:hC34:S19.2E:27500:1535:1536=deu:32:1702,1801,1722:41:133:2:0 PREMIERE 7,PREM 7;PREMIERE:11797:hC34:S19.2E:27500:1023:1024=deu:32:1722,1801,1702:20:133:2:0 -DISNEY CHANNEL,DISNEY;PREMIERE:11758:hC34:S19.2E:27500:2559:2560=deu:0:1801,1722,1702:34:133:17:0 +DISNEY CHANNEL,DISNEY;PREMIERE:11758:hC34:S19.2E:27500:2559:2560=deu:0:1722,1702,1801:34:133:17:0 :Premiere Direkt PREMIERE DIREKT,DIREKT;PREMIERE:12031:hC34:S19.2E:27500:2815:2816=deu,2817=deu;2819=deu:0:0:18:133:4:0 :PW Erotic BEATE-UHSE.TV,B-UHSE;PREMIERE:12070:hC34:S19.2E:27500:1023:1024=deu:32:1702,1801,1722:21:133:1:0 DIREKT EROTIK,EROTIK;PREMIERE:12031:hC34:S19.2E:27500:1279:0:0:1722,1801,1702:513:133:4:0 :Sportsworld -Konferenz:11719:hC34:S19.2E:27500:255:256=deu,257=deu:32:1702,1722,1801:17:133:3:0 -PREMIERE SPORT 2,SPORT 2;PREMIERE:12031:hC34:S19.2E:27500:3839:3840=deu,3841=deu:32:1702,1801,1722:27:133:4:0 +Konferenz:11719:hC34:S19.2E:27500:255:256=deu,257=deu:32:1702,1801,1722:17:133:3:0 +PREMIERE SPORT 2,SPORT 2;PREMIERE:12031:hC34:S19.2E:27500:3839:3840=deu,3841=deu:32:1722,1702,1801:27:133:4:0 :Beta Digital N24;ProSiebenSat.1:12480:vC34:S19.2E:27500:2047:2048=deu:36:0:47:133:33:0 LibertyTV FR;LibertyTV.com:12610:vC56:S19.2E:22000:941:943=deu:0:0:12199:1:1112:0 diff --git a/config.h b/config.h index 64ebe7c..7dffe14 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.212 2005/02/05 10:43:22 kls Exp $ + * $Id: config.h 1.213 2005/02/08 11:22:14 kls Exp $ */ #ifndef __CONFIG_H @@ -20,8 +20,8 @@ #include "i18n.h" #include "tools.h" -#define VDRVERSION "1.3.20" -#define VDRVERSNUM 10320 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.3.21" +#define VDRVERSNUM 10321 // Version * 10000 + Major * 100 + Minor #define MAXPRIORITY 99 #define MAXLIFETIME 99 diff --git a/device.c b/device.c index 46e23bc..f270b5a 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.87 2005/02/06 14:10:37 kls Exp $ + * $Id: device.c 1.92 2005/02/13 09:51:48 kls Exp $ */ #include "device.h" @@ -756,7 +756,8 @@ void cDevice::EnsureAudioTrack(bool Force) // Make sure we're set to an available audio track: const tTrackId *Track = GetTrack(GetCurrentAudioTrack()); if (Force || !Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) { - dsyslog("setting audio track to %d", PreferredTrack); + if (!Force) // only log this for automatic changes + dsyslog("setting audio track to %d", PreferredTrack); SetCurrentAudioTrack(PreferredTrack); } } @@ -882,8 +883,11 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) break; case 0xC0 ... 0xDF: // audio SetAvailableTrack(ttAudio, c - 0xC0, c); - if (!VideoOnly && c == availableTracks[currentAudioTrack].id) + if (!VideoOnly && c == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); + if (FirstLoop) + Audios.PlayAudio(Data, Length, c); + } break; case 0xBD: { // private stream 1 int PayloadOffset = Data[8] + 9; @@ -892,6 +896,7 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) uchar SubStreamIndex = SubStreamId & 0x1F; // Compatibility mode for old VDR recordings, where 0xBD was only AC3: +pre_1_3_19_PrivateStreamDeteced: if (pre_1_3_19_PrivateStream) { SubStreamId = c; SubStreamType = 0x80; @@ -907,15 +912,18 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) SetAvailableTrack(ttDolby, SubStreamIndex, SubStreamId); if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); - if (FirstLoop && !(SubStreamId & 0x08)) // no DTS - Audios.PlayAudio(Data, Length); + if (FirstLoop) + Audios.PlayAudio(Data, Length, SubStreamId); } } break; case 0xA0: // LPCM SetAvailableTrack(ttAudio, SubStreamIndex, SubStreamId); - if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) + if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); + if (FirstLoop) + Audios.PlayAudio(Data, Length, SubStreamId); + } break; default: // Compatibility mode for old VDR recordings, where 0xBD was only AC3: @@ -923,6 +931,7 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) dsyslog("switching to pre 1.3.19 Dolby Digital compatibility mode"); ClrAvailableTracks(); pre_1_3_19_PrivateStream = true; + goto pre_1_3_19_PrivateStreamDeteced; } } } @@ -984,7 +993,7 @@ int cDevice::PlayPes(const uchar *Data, int Length, bool VideoOnly) int w = PlayPesPacket(Data + i, l, VideoOnly); if (w > 0) i += l; - else if (w < 0) + else return i == 0 ? w : i; } else diff --git a/dvbdevice.c b/dvbdevice.c index 269c0a2..741848a 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.117 2005/02/06 12:30:14 kls Exp $ + * $Id: dvbdevice.c 1.120 2005/02/13 14:26:37 kls Exp $ */ #include "dvbdevice.h" @@ -346,6 +346,7 @@ void cDvbTuner::Action(void) // --- cDvbDevice ------------------------------------------------------------ int cDvbDevice::devVideoOffset = -1; +bool cDvbDevice::setTransferModeForDolbyDigital = true; cDvbDevice::cDvbDevice(int n) { @@ -768,8 +769,8 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) ); bool StartTransferMode = IsPrimaryDevice() && !IsEncrypted && !DoTune - && (LiveView && HasPid(Channel->Vpid()) && pidHandles[ptVideo].pid != Channel->Vpid() // the PID is already set as DMX_PES_OTHER - || !LiveView && pidHandles[ptVideo].pid == Channel->Vpid() // a recording is going to shift the PIDs from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER + && (LiveView && HasPid(Channel->Vpid() ? Channel->Vpid() : Channel->Apid(0)) && (pidHandles[ptVideo].pid != Channel->Vpid() || pidHandles[ptAudio].pid != Channel->Apid(0))// the PID is already set as DMX_PES_OTHER + || !LiveView && (pidHandles[ptVideo].pid == Channel->Vpid() || pidHandles[ptAudio].pid == Channel->Apid(0)) // a recording is going to shift the PIDs from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER ); bool TurnOnLivePIDs = HasDecoder() && !StartTransferMode @@ -861,15 +862,24 @@ void cDvbDevice::SetDigitalAudioDevice(bool On) } } +void cDvbDevice::SetTransferModeForDolbyDigital(bool On) +{ + setTransferModeForDolbyDigital = On; +} + void cDvbDevice::SetAudioTrackDevice(eTrackType Type) { const tTrackId *TrackId = GetTrack(Type); if (TrackId && TrackId->id) { if (IS_AUDIO_TRACK(Type)) { - pidHandles[ptAudio].pid = TrackId->id; - SetPid(&pidHandles[ptAudio], ptAudio, true); + if (pidHandles[ptAudio].pid) { + pidHandles[ptAudio].pid = TrackId->id; + SetPid(&pidHandles[ptAudio], ptAudio, true); + } } else if (IS_DOLBY_TRACK(Type)) { + if (!setTransferModeForDolbyDigital) + return; // Currently this works only in Transfer Mode cChannel *Channel = Channels.GetByNumber(CurrentChannel()); if (Channel) diff --git a/dvbdevice.h b/dvbdevice.h index 233515d..99456e7 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.32 2005/01/06 13:30:51 kls Exp $ + * $Id: dvbdevice.h 1.33 2005/02/13 14:14:31 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -99,11 +99,14 @@ protected: private: bool digitalAudio; + static bool setTransferModeForDolbyDigital; protected: virtual int GetAudioChannelDevice(void); virtual void SetAudioChannelDevice(int AudioChannel); virtual void SetVolumeDevice(int Volume); virtual void SetDigitalAudioDevice(bool On); +public: + static void SetTransferModeForDolbyDigital(bool On); // Player facilities diff --git a/dvbosd.c b/dvbosd.c index fbf6f61..360825f 100644 --- a/dvbosd.c +++ b/dvbosd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.c 1.25 2004/11/20 14:29:25 kls Exp $ + * $Id: dvbosd.c 1.26 2005/02/12 15:36:31 kls Exp $ */ #include "dvbosd.h" @@ -48,6 +48,13 @@ cDvbOsd::cDvbOsd(int Left, int Top, int OsdDev) cap.cmd = OSD_CAP_MEMSIZE; if (ioctl(osdDev, OSD_GET_CAPABILITY, &cap) == 0) osdMem = cap.val; + #define FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + //XXX This is a very ugly hack to allow cDvbOsd to reduce the buffer + //XXX requirements in cTransfer if it detects a 4MB full featured DVB card. + extern bool DvbCardWith4MBofSDRAM; + DvbCardWith4MBofSDRAM = osdMem >= 1000000; + #endif #endif // must clear all windows here to avoid flashing effects - doesn't work if done // in Flush() only for the windows that are actually used... diff --git a/i18n.c b/i18n.c index b6c8800..9d7417c 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.175 2005/02/05 10:46:30 kls Exp $ + * $Id: i18n.c 1.177 2005/02/12 10:26:51 kls Exp $ * * Translations provided by: * @@ -2829,6 +2829,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Durée affichage infos chaînes (s)", "",// TODO + "Kanavatiedon esitysaika (s)", "",// TODO "",// TODO "",// TODO @@ -2839,8 +2840,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "",// TODO "",// TODO - "",// TODO - "",// TODO + "Tid kanalinfo skal vises (s)", }, { "Setup.OSD$Info on channel switch", "Info beim Kanalwechsel", diff --git a/player.h b/player.h index 3ffc7e3..6b08178 100644 --- a/player.h +++ b/player.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: player.h 1.15 2005/02/06 11:44:56 kls Exp $ + * $Id: player.h 1.16 2005/02/12 14:45:29 kls Exp $ */ #ifndef __PLAYER_H @@ -19,7 +19,9 @@ private: cDevice *device; ePlayMode playMode; protected: + void DeviceClrAvailableTracks(bool DescriptionsOnly = false) { if (device) device->ClrAvailableTracks(DescriptionsOnly); } bool DeviceSetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, const char *Description = NULL) { return device ? device->SetAvailableTrack(Type, Index, Id, Language, Description) : false; } + bool DeviceSetCurrentAudioTrack(eTrackType Type) { return device ? device->SetCurrentAudioTrack(Type) : false; } bool DevicePoll(cPoller &Poller, int TimeoutMs = 0) { return device ? device->Poll(Poller, TimeoutMs) : false; } bool DeviceFlush(int TimeoutMs = 0) { return device ? device->Flush(TimeoutMs) : true; } void DeviceTrickSpeed(int Speed) { if (device) device->TrickSpeed(Speed); } diff --git a/recording.c b/recording.c index c6460f2..e50dfcb 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.95 2005/02/06 09:46:31 kls Exp $ + * $Id: recording.c 1.96 2005/02/12 10:17:47 kls Exp $ */ #include "recording.h" @@ -637,8 +637,9 @@ void cRecordings::ScanVideoDir(const char *DirName) struct stat st; if (stat(buffer, &st) == 0) { if (S_ISLNK(st.st_mode)) { - free(buffer); - buffer = ReadLink(buffer); + char *old = buffer; + buffer = ReadLink(old); + free(old); if (!buffer) continue; if (stat(buffer, &st) != 0) { diff --git a/remux.c b/remux.c index 49bd898..ca65a61 100644 --- a/remux.c +++ b/remux.c @@ -11,7 +11,7 @@ * The cDolbyRepacker code was originally written by Reinhard Nissl , * and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de. * - * $Id: remux.c 1.28 2005/02/05 11:56:42 kls Exp $ + * $Id: remux.c 1.31 2005/02/13 14:36:23 kls Exp $ */ #include "remux.h" @@ -29,6 +29,7 @@ protected: public: cRepacker(void) { maxPacketSize = 6 + 65535; subStreamId = 0; } virtual ~cRepacker() {} + virtual void Reset(void) {} virtual int Put(cRingBufferLinear *ResultBuffer, const uchar *Data, int Count) = 0; virtual int BreakAt(const uchar *Data, int Count) = 0; void SetMaxPacketSize(int MaxPacketSize) { maxPacketSize = MaxPacketSize; } @@ -56,13 +57,13 @@ private: get_length, output_packet } state; - void Reset(void); void ResetPesHeader(void); void AppendSubStreamID(void); bool FinishRemainder(cRingBufferLinear *ResultBuffer, const uchar *const Data, const int Todo, int &Done, int &Bite); bool StartNewPacket(cRingBufferLinear *ResultBuffer, const uchar *const Data, const int Todo, int &Done, int &Bite); public: cDolbyRepacker(void); + virtual void Reset(void); virtual int Put(cRingBufferLinear *ResultBuffer, const uchar *Data, int Count); virtual int BreakAt(const uchar *Data, int Count); }; @@ -474,6 +475,8 @@ cTS2PES::~cTS2PES() void cTS2PES::Clear(void) { reset_ipack(); + if (repacker) + repacker->Reset(); } void cTS2PES::store(uint8_t *Data, int Count) @@ -1007,6 +1010,9 @@ void cRemux::Clear(void) for (int t = 0; t < numTracks; t++) ts2pes[t]->Clear(); resultBuffer->Clear(); + synced = false; + skipped = 0; + resultSkipped = 0; } void cRemux::SetBrokenLink(uchar *Data, int Length) diff --git a/tools.h b/tools.h index bf19089..be8782b 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 1.66 2005/02/05 10:00:22 kls Exp $ + * $Id: tools.h 1.67 2005/02/12 10:17:14 kls Exp $ */ #ifndef __TOOLS_H @@ -95,7 +95,7 @@ bool DirectoryOk(const char *DirName, bool LogErrors = false); bool MakeDirs(const char *FileName, bool IsDirectory = false); bool RemoveFileOrDir(const char *FileName, bool FollowSymlinks = false); bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis = false); -char *ReadLink(const char *FileName); +char *ReadLink(const char *FileName); ///< returns a new strings allocated on the heap, which the caller must delete (or NULL in case of an error) bool SpinUpDisk(const char *FileName); time_t LastModifiedTime(const char *FileName); cString WeekDayName(int WeekDay); diff --git a/transfer.c b/transfer.c index b3cbec4..331ac62 100644 --- a/transfer.c +++ b/transfer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.c 1.25 2005/01/23 14:27:40 kls Exp $ + * $Id: transfer.c 1.27 2005/02/12 15:54:06 kls Exp $ */ #include "transfer.h" @@ -54,24 +54,26 @@ void cTransfer::Receive(uchar *Data, int Length) } } +#define FW_NEEDS_BUFFER_RESERVE_FOR_AC3 +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 +//XXX This is a very ugly hack to allow cDvbOsd to reduce the buffer +//XXX requirements in cTransfer if it detects a 4MB full featured DVB card. +bool DvbCardWith4MBofSDRAM = false; +#endif + void cTransfer::Action(void) { int PollTimeouts = 0; uchar *p = NULL; int Result = 0; -#define FW_NEEDS_BUFFER_RESERVE_FOR_AC3 #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 - bool Cleared = false; bool GotBufferReserve = false; + int RequiredBufferReserve = KILOBYTE(DvbCardWith4MBofSDRAM ? 288 : 576); #endif active = true; while (active) { #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 - if (needsBufferReserve) { - if (IsAttached() && !Cleared) { - PlayPes(NULL, 0); - Cleared = true; - } + if (needsBufferReserve && !GotBufferReserve) { //XXX For dolby we've to fill the buffer because the firmware does //XXX not decode dolby but use a PCM stream for transport, therefore //XXX the firmware has not enough buffer for noiseless skipping early @@ -79,14 +81,12 @@ void cTransfer::Action(void) //XXX audio is mostly to early in comparison to video). //XXX To resolve this, the remuxer or PlayPes() should synchronize //XXX audio with the video frames. 2004/09/09 Werner - if (!GotBufferReserve) { - if (ringBuffer->Available() < 3 * KILOBYTE(192) / 2) { // used to be MAXFRAMESIZE, but the HDTV value of KILOBYTE(512) is way too much here - cCondWait::SleepMs(20); // allow the buffer to collect some reserve - continue; - } - else - GotBufferReserve = true; + if (ringBuffer->Available() < RequiredBufferReserve) { // used to be MAXFRAMESIZE, but the HDTV value of KILOBYTE(512) is way too much here + cCondWait::SleepMs(20); // allow the buffer to collect some reserve + continue; } + else + GotBufferReserve = true; } #endif int Count; @@ -98,10 +98,14 @@ void cTransfer::Action(void) // So let's clear the buffer instead of suffering from permanent // overflows. dsyslog("clearing transfer buffer to avoid overflows"); + DeviceClear(); ringBuffer->Clear(); remux->Clear(); PlayPes(NULL, 0); p = NULL; +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + GotBufferReserve = false; +#endif continue; } Count = remux->Put(b, Count); @@ -132,7 +136,11 @@ void cTransfer::Action(void) DeviceClear(); ringBuffer->Clear(); remux->Clear(); + PlayPes(NULL, 0); p = NULL; +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + GotBufferReserve = false; +#endif } } } diff --git a/vdr.c b/vdr.c index 6b2ac37..15aff94 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.201 2005/01/30 14:15:50 kls Exp $ + * $Id: vdr.c 1.202 2005/02/12 15:06:16 kls Exp $ */ #include @@ -100,8 +100,8 @@ int main(int argc, char *argv[]) // Check for UTF-8 and exit if present - asprintf() will fail if it encounters 8 bit ASCII codes char *LangEnv; - if ((LangEnv = getenv("LANG")) != NULL && strcasestr(LangEnv, "utf") || - (LangEnv = getenv("LC_TYPE")) != NULL && strcasestr(LangEnv, "utf")) { + if ((LangEnv = getenv("LANG")) != NULL && strcasestr(LangEnv, "utf") || + (LangEnv = getenv("LC_CTYPE")) != NULL && strcasestr(LangEnv, "utf")) { fprintf(stderr, "vdr: please turn off UTF-8 before starting VDR\n"); return 2; } -- cgit v1.2.3