Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] AW: Re: popen for ac3 and thread (ringbuffer) problem



Hi,
two files are patched: dvbapi.c and dvbapi.h
these are quick and dirty patches, not more (only for test)!
The diffs contains the modified pause/play for dvd too, sorry.

Bye
Andreas

--- dvbapi.h.org	Sat Aug 11 14:22:01 2001
+++ dvbapi.h	Wed Aug 15 22:09:40 2001
@@ -89,6 +89,7 @@
   cDvbApi(int n);
 public:
   ~cDvbApi();
+  FILE *dolbyDev;//!!!!

 #define MAXDVBAPI 4
   static int NumDvbApis;


--- dvbapi.c.org	Sun Aug 12 17:09:42 2001
+++ dvbapi.c	Wed Aug 15 22:21:06 2001
@@ -672,17 +672,19 @@
   canDoTrickMode = false;
   canToggleAudioTrack = false;
   audioTrack = 0xC0;
-  if (cDvbApi::AudioCommand()) {
-     dolbyDev = popen(cDvbApi::AudioCommand(), "w");
-     if (!dolbyDev)
-        esyslog(LOG_ERR, "ERROR: can't open pipe to audio command '%s'",
cDvbApi::AudioCommand());
-     }
+
+  dolbyDev = DvbApi->dolbyDev; //!!!!
+//!!!!  if (cDvbApi::AudioCommand()) {
+//!!!!     dolbyDev = popen(cDvbApi::AudioCommand(), "w");
+//!!!!     if (!dolbyDev)
+//!!!!        esyslog(LOG_ERR, "ERROR: can't open pipe to audio command
'%s'", cDvbApi::AudioCommand());
+//!!!!     }
 }

 cPlayBuffer::~cPlayBuffer()
 {
-  if (dolbyDev)
-     pclose(dolbyDev);
+//!!!!  if (dolbyDev)
+//!!!!     pclose(dolbyDev);
 }

 void cPlayBuffer::Output(void)
@@ -747,7 +749,8 @@
 void cPlayBuffer::Pause(void)
 {
   paused = !paused;
-  bool empty = fastForward || fastRewind;
+  //old: bool empty = fastForward || fastRewind;
+  bool empty = fastForward || fastRewind || !paused; //!!!!
   if (empty)
      Empty(true);
   fastForward = fastRewind = false;
@@ -761,7 +764,8 @@
 void cPlayBuffer::Play(void)
 {
   if (fastForward || fastRewind || paused) {
-     bool empty = !paused || fastRewind;
+     bool empty = !paused || fastRewind || (paused && fastForward ||
!fastRewind);//!!!!
+//old: bool empty = !paused || fastRewind;
      if (empty)
         Empty(true);
      still = false;
@@ -2338,7 +2342,16 @@
   // Devices that may not be available, and are not necessary for normal
operation:

   videoDev   = OstOpen(DEV_VIDEO,      n, O_RDWR);
-
+
+  if (AudioCommand() && n==0) {
+     dolbyDev = popen(AudioCommand(), "w");
+     if (!dolbyDev) {
+        esyslog(LOG_ERR, "ERROR: can't open pipe to audio command '%s'",
cDvbApi::AudioCommand());
+     }
+     else {
+       dolbyDev = NULL;
+     }
+  }
   // Devices that will be dynamically opened and closed when necessary:

   fd_dvr     = -1;
@@ -2831,6 +2844,8 @@
   delete osd;
   osd = NULL;
 #endif
+  if (dolbyDev)//!!!!
+     pclose(dolbyDev);//!!!!
 }

 void cDvbApi::Clear(void)

-----Ursprüngliche Nachricht-----
Von: linux-dvb-bounce@linuxtv.org
[mailto:linux-dvb-bounce@linuxtv.org]Im Auftrag von Robert Schneider
Gesendet: Mittwoch, 15. August 2001 21:32
An: linux-dvb@linuxtv.org
Betreff: [linux-dvb] Re: popen for ac3 and thread (ringbuffer) problem


I can confirm that behaviour. I first thought this is something that comes
with the newest drivers but it's true, I can reproduce that reliably.

Andreas,

could you provide the little diff with your change so that I can check
whether the problem gets cured at my end?

Regards,

Robert





Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
Sent by: kls@cadsoft.de
15.08.2001 11:11
Please respond to Klaus Schmidinger


        To:     Linux-Dvb <linux-dvb@linuxtv.org>
        cc:
        Subject:        [linux-dvb] Re: popen for ac3 and thread
(ringbuffer) problem



Andreas Vitting wrote:
>
> Hi Klaus,
> do you know about the problem with the popen function ? You opened it
into a
> new Thread, so the thread is the main process for the ac3 decoder
(-shell).
> All standard outputs going to the pipe, isn't it ??
> Here is my problem:
> if i open the osd menu (with and w/o ac3 data), vdr crashes and after a
> while the dvb driver too (after 10-20 seconds). I have changed for
> experimental purposes the popen command to the cDvbApi init routine
(near to
> OstOpen) and know, you don't believe this,no crashes anymore.
> This behavior is as soon as we start the vdr with the -a switch (it
doesn't
> matter, if the recordings were with or w/o ac3 data)

Can anybody else confirm this behaviour?

I like the idea that the AC3 decoder ist started only when an actual
replay is performed, and not running all the time, so I would like
to be very certain about the necessity of this change.

Klaus
--
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe
linux-dvb" as subject.






--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe
linux-dvb" as subject.



--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.


Home | Main Index | Thread Index