[mythtv] [PATCH] External channel changer's exit code missed

Richard Gering RGering at serena.com
Sat Jan 22 03:36:26 EST 2005


Greetings,

The current implementation of the external channel changer misses the
exit code set by that changer, because it (accidentally) runs that
program as an additional background process.

There is nothing wrong with channelbase.cpp's forking code that launches
the shell that runs the channel changer, but the problem is that this
shell is also requested to run the program as a background process. The
result is that Myth only sees the exit code from the shell, which simply
reports that it successfully launched the background process.  It
doesn't get to see the exit code of the channel changer itself

(I found this out when Zap2It added a new channel to my lineup, one I
cannot receive, which aired a show I wanted to record a few hours before
it was shown on local TV.  Because the recording type was "any channel",
MythTV tried to switch to the invalid channel, my SAT receiver
complained that it could not, but MythTV thought all was well and deemed
the show successfully recorded.  Instead, it recorded whatever channel
was on when the recording started.)

The fix is VERY simple: drop the "&" from the command being passed to
the shell.  Here is the diff -c output, based on today's CVS:

[mythtv at opus libmythtv]$ diff -c channelbase.cpp.org channelbase.cpp
*** channelbase.cpp.org 2005-01-07 16:22:58.000000000 -0800
--- channelbase.cpp     2005-01-21 16:12:48.000000000 -0800
***************
*** 132,138 ****
      if (externalChanger[currentcapchannel].isEmpty())
          return false;

!     QString command = QString("%1 %2
&").arg(externalChanger[currentcapchannel])
                                          .arg(channum);

      VERBOSE(VB_CHANNEL, QString("External channel change:
%1").arg(command));
--- 132,138 ----
      if (externalChanger[currentcapchannel].isEmpty())
          return false;

!     QString command = QString("%1
%2").arg(externalChanger[currentcapchannel])
                                          .arg(channum);

      VERBOSE(VB_CHANNEL, QString("External channel change:
%1").arg(command));


The change is working well for me :-)

Kind regards,

- Richard Gering.



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.



More information about the mythtv-dev mailing list