[mythtv-commits] Ticket #13247: Backend won't change inputs with PVR-150 - regression from 27.6

MythTV noreply at mythtv.org
Thu Mar 15 04:24:36 UTC 2018


#13247: Backend won't change inputs with PVR-150 - regression from 27.6
----------------------------------+--------------------------
 Reporter:  ltskinol@…            |          Owner:  gigem
     Type:  Bug Report - General  |         Status:  assigned
 Priority:  major                 |      Milestone:  30.0
Component:  MythTV - Recording    |        Version:  v29.1
 Severity:  medium                |     Resolution:
 Keywords:                        |  Ticket locked:  0
----------------------------------+--------------------------

Comment (by ltskinol@…):

 The patch didn't work for me (which didn't make sense), so I poked around
 some more.  My theory was that the old "recreate the channel" logic was
 needed to be in, but that seemed like a hack, so I added a bunch of debug
 statements.  What I found was that Myth created two TVRec's, and then
 worked with one or the other based on what input it's using - just as you
 mentioned.  The issue seems to be in V4LChannel::SetFormat(), in this
 code:

 {{{
     if ((fmt == currentFormat) || SetInputAndFormat(inputNum, fmt))
     {
         currentFormat = fmt;
     }
 }}}

 That looks a little wonky to me because:

 - Shouldn't SetFormat() only change the format?
 - It doesn't seem to consider what happens if the format is unchanged but
 the input is changed.

 But let's say that somehow the class remembers the input and handles that
 elsewhere.  If, as I'm using it, two instances of V4LChannel share the
 same physical hardware, then the input selection can change behind the
 back of class instance one by class instance two.

 I changed the code to simply say:

 {{{
     if (SetInputAndFormat(inputNum, fmt))
     {
         currentFormat = fmt;
     }
 }}}

 And things work as expected, with the input change only happening when
 what the class instance wants doesn't match how the actual hardware is
 set.  I don't think this is less efficient, either, as various things are
 only commanded to change when the actual hardware is out of sync.

 This also fixes live TV tuning, so I'm going to say win-win.

 Let me know what you think.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13247#comment:7>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list