Re: [vdr] [PATCH] Small change to correctly query the systems charset

2007-05-06 Thread Klaus Schmidinger
On 05/01/07 17:12, Matthias Schwarzott wrote:
 Hi there!
 
 This patch just changes charset querying to not only look at environment 
 variable LANG, but respect all in correct order. So now I can overwrite 
 charset setting with LC_CTYPE and LC_ALL.
 
 Greetings
 Matthias
 
 
 
 
 
 diff -ru vdr-1.5.2-vanilla/vdr.c vdr-1.5.2/vdr.c
 --- vdr-1.5.2-vanilla/vdr.c   2007-05-01 17:04:45.0 +0200
 +++ vdr-1.5.2/vdr.c   2007-05-01 17:05:18.0 +0200
 @@ -493,7 +493,7 @@
  
// Set the system character table:
  
 -  char *LangEnv = getenv(LANG);
 +  char *LangEnv = setlocale(LC_CTYPE, );
if (LangEnv) {
   char *CodeSet = strchr(LangEnv, '.');
   if (CodeSet) {
 
 
 

If I make this change and run VDR with

export LANG=de_DE.iso8859-15

I get a NULL pointer from the setlocale(LC_CTYPE, ) call.
Only with

export LANG=de_DE.iso8859-1

do I get a non-NULL result.
Am I missing something here?

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Small change to correctly query the systems charset

2007-05-06 Thread Johannes Stezenbach
On Sun, May 06, 2007 at 11:50:21AM +0200, Klaus Schmidinger wrote:
 If I make this change and run VDR with
 
 export LANG=de_DE.iso8859-15
 
 I get a NULL pointer from the setlocale(LC_CTYPE, ) call.
 Only with
 
 export LANG=de_DE.iso8859-1
 
 do I get a non-NULL result.
 Am I missing something here?

Maybe you don't have the locale files for iso8859-15 installed?
(At least in Debian you can choose to install only a subset of
the glibc locale files.)


HTH,
Johannes

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] Re: [PATCH] Small change to correctly query the systems charset

2007-05-06 Thread Michael Mauch
Klaus Schmidinger wrote:

 If I make this change and run VDR with
 
 export LANG=de_DE.iso8859-15
 
 I get a NULL pointer from the setlocale(LC_CTYPE, ) call.
 Only with
 
 export LANG=de_DE.iso8859-1
 
 do I get a non-NULL result.
 Am I missing something here?

Do you have a de_DE.iso8859-15 installed? It's called [EMAIL PROTECTED] here
(yes, that naming is a bit strange).

You can check with locale -a | grep de to find the installed locales
for de. If no suitable locale is there, you can use locale-gen (at
least on Debian and Gentoo) or localedef to install the missing locale.

Regards...
Michael


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] Cut marks editing problem

2007-05-06 Thread Olaf Titz
I'm editing a recording with some errors in it (errors of the kind
broken MPEG kills vdr-sxfe). Looks like the index.vdr is broken, so
I run genindex. After that, some existing cut marks are not on a GOP
boundary any more (looks like genindex really has fixed something). I
can't edit these cut marks any more. When I put the cursor on the
broken mark, neither of 4 6 7 9 keys do anything. With 0 the mark is
not deleted, rather a new one generated at the right position but I
can't get rid of the broken mark.

Proposed fix: on the 7 and 9 keys, look if the mark is really on a GOP
boundary, and if not, scan for the next one, adjusting the mark.
This would also help with manual editing of the marks.vdr file.

Olaf

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Cut marks editing problem

2007-05-06 Thread Udo Richter

Olaf Titz wrote:

After that, some existing cut marks are not on a GOP
boundary any more (looks like genindex really has fixed something). I
can't edit these cut marks any more. 
[...]

Proposed fix: on the 7 and 9 keys, look if the mark is really on a GOP
boundary, and if not, scan for the next one, adjusting the mark.
This would also help with manual editing of the marks.vdr file.


Just my 2c:

Since the index and cut marks file is read completely at the beginning 
of playback, its a lot easier just to let all cut marks 'snap' on valid 
GOP boundaries on loading, so they never are on wrong positions.


Cheers,

Udo

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] [ANNOUNCE] VDR sync early patch

2007-05-06 Thread Reinhard Nissl
Hi,

the motivation for this patch was to speed up zapping channels when
using vdr-xine, i. e. to shorten the time from pressing the remote
button till audio and video appear.

FF card users may only see the effect of this patch when the FF card is
running in transfer mode.

The idea is to not wait for the first I frame in transfer mode. Although
output devices can't decode any frames before the first I frame, the
contained PTS in the PES packets allows the device to synchronize audio
and video even before the first video frame appears on screen.

Another issue which is addressed by this patch is that audio packets
were not delivered to the device immediately after switching the
channel, so the above change didn't have any effect. Calling
EnsureAudioTrack() fixes this.

How much speed up can be expected? Well, it varies from zap to zap as it
depends on a couple of parameters like the offset of audio and video
PTS, whether a PTS is available per frame, the number of frames till the
next I frame arrives, etc. But a speed up should be noticeable.

BTW: Testers of plugin ** should comment out the following line in
cTSBuffer::Get() in file device.c, like that:

//if(!device-***) device-***=new c***;

This change is highly recommended if you experience buffer overflows
while switching channels, though they are not related to the sync early
patch.

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:[EMAIL PROTECTED]
diff -Nurp ../vdr-1.4.6-1-orig/device.c ./device.c
--- ../vdr-1.4.6-1-orig/device.c	2006-09-03 12:13:25.0 +0200
+++ ./device.c	2007-05-06 21:22:52.0 +0200
@@ -691,7 +691,7 @@ eSetChannelResult cDevice::SetChannel(co
for (int i = 0; i  MAXDPIDS; i++)
SetAvailableTrack(ttDolby, i, Channel-Dpid(i), Channel-Dlang(i));
}
-if (!NeedsTransferMode)
+if (!NeedsTransferMode || GetCurrentAudioTrack() == ttNone)
EnsureAudioTrack(true);
 }
  cStatus::MsgChannelSwitch(this, Channel-Number()); // only report status if channel switch successfull
diff -Nurp ../vdr-1.4.6-1-orig/remux.c ./remux.c
--- ../vdr-1.4.6-1-orig/remux.c	2006-12-01 15:46:25.0 +0100
+++ ./remux.c	2007-05-06 21:22:52.0 +0200
@@ -1853,12 +1853,13 @@ void cTS2PES::ts_to_pes(const uint8_t *B
 
 #define RESULTBUFFERSIZE KILOBYTE(256)
 
-cRemux::cRemux(int VPid, const int *APids, const int *DPids, const int *SPids, bool ExitOnFailure)
+cRemux::cRemux(int VPid, const int *APids, const int *DPids, const int *SPids, bool ExitOnFailure, bool SyncEarly)
 {
   exitOnFailure = ExitOnFailure;
   isRadio = VPid == 0 || VPid == 1 || VPid == 0x1FFF;
   numUPTerrors = 0;
   synced = false;
+  syncEarly = SyncEarly;
   skipped = 0;
   numTracks = 0;
   resultSkipped = 0;
@@ -2062,12 +2063,14 @@ uchar *cRemux::Get(int Count, uchar *Pi
 cThread::EmergencyExit(true);
  }
   else if (!synced) {
- if (pt == I_FRAME) {
+ if (pt == I_FRAME || syncEarly) {
 if (PictureType)
*PictureType = pt;
 resultSkipped = i; // will drop everything before this position
-SetBrokenLink(data + i, l);
 synced = true;
+if (pt == I_FRAME) // syncEarly: it's ok but there is no need to call SetBrokenLink()
+   SetBrokenLink(data + i, l);
+else fprintf(stderr, video: synced early\n);
 }
  }
   else if (Count)
@@ -2080,12 +2083,13 @@ uchar *cRemux::Get(int Count, uchar *Pi
l = GetPacketLength(data, resultCount, i);
if (l  0)
   return resultData;
-   if (isRadio) {
+   if (isRadio || !synced  syncEarly) {
   if (!synced) {
- if (PictureType)
+ if (PictureType  isRadio)
 *PictureType = I_FRAME;
  resultSkipped = i; // will drop everything before this position
  synced = true;
+if (!isRadio) fprintf(stderr, audio: synced early\n);
  }
   else if (Count)
  return resultData;
diff -Nurp ../vdr-1.4.6-1-orig/remux.h ./remux.h
--- ../vdr-1.4.6-1-orig/remux.h	2006-03-25 13:27:30.0 +0100
+++ ./remux.h	2007-05-06 21:22:52.0 +0200
@@ -40,6 +40,7 @@ private:
   bool isRadio;
   int numUPTerrors;
   bool synced;
+  bool syncEarly;
   int skipped;
   cTS2PES *ts2pes[MAXTRACKS];
   int numTracks;
@@ -47,12 +48,13 @@ private:
   int resultSkipped;
   int GetPid(const uchar *Data);
 public:
-  cRemux(int VPid, const int *APids, const int *DPids, const int *SPids, bool ExitOnFailure = false);
+  cRemux(int VPid, const int *APids, const int *DPids, const int *SPids, bool ExitOnFailure = false, bool SyncEarly =