reopen 325595
tags 325595 patch
found 325595 0.5-2
retitle 325595 dvbstream: -n command line option fails
thanks


"-n secs     Stop after secs seconds"

The "-n secs" option doesn't work. This fixes it. The first patch is for 
the vanilla dvbstream source. The second patch is for if you've applied 
the select() patch from #360292.

-- 
Paul Martin <[EMAIL PROTECTED]>
--- dvbstream.c~        2004-02-11 15:34:21.000000000 +0000
+++ dvbstream.c 2006-04-01 19:34:04.000000000 +0100
@@ -837,8 +837,8 @@
   pfds[1].events=POLLIN|POLLPRI;
 
   /* Set up timer */
-  //  if (secs > 0) alarm(secs);
-  while ( !Interrupted) {
+  if (secs > 0) alarm(secs);
+  while ( !Interrupted && ((secs == 0) || (now<secs)) ) {
     /* Poll the open file descriptors */
     if (ns==-1) {
         poll(pfds,1,500);
--- dvbstream.c~        2006-04-01 19:38:06.000000000 +0100
+++ dvbstream.c 2006-04-01 19:39:09.000000000 +0100
@@ -812,8 +812,8 @@
   }
 
   /* Set up timer */
-  //  if (secs > 0) alarm(secs);
-  while ( !Interrupted) {
+  if (secs > 0) alarm(secs);
+  while ( !Interrupted && ((secs == 0) || (now<secs)) ) {
     // setup select descriptor set
     // we always wait on DVR device and
     // either the socket or telnet session

Reply via email to