[mythtv-commits] Ticket #3963: [PATCH] Use DTVRecorder::Reset() instead of derived class' Reset()

MythTV mythtv at cvs.mythtv.org
Sat Sep 15 22:03:39 UTC 2007


#3963: [PATCH] Use DTVRecorder::Reset() instead of derived class' Reset()
------------------------------------------------+---------------------------
 Reporter:  Shane Shrybman <gnome42 at gmail.com>  |        Owner:  danielk
     Type:  patch                               |       Status:  new    
 Priority:  minor                               |    Milestone:  0.21   
Component:  mythtv                              |      Version:  head   
 Severity:  medium                              |   Resolution:         
  Mlocked:  0                                   |  
------------------------------------------------+---------------------------

Comment(by Shane Shrybman <gnome42 at gmail.com>):

 oops, I meant derived class of course :) ( DTVRecorder::ResetForNewFile?()
 calls the derived class' Reset() which ...)

 Yet another way to solve this problem. Make DTVRecorder::ResetForNewFile()
 do nothing.:)

 I like this better because it solves the posmap problem and cleans up the
 redundant Reset's that occur with DTV recorders.

 Because DTVRecorder::ResetForNewFile(void) does one thing only, calls
 Reset(), we end up doing redundant Reset()'s in the case of DTVRecorders
 when Reset() is called after ResetForNewFile(void).

 this happens in DTV livetv:

 TVRec::TuningRestartRecorder(void)
   TVRec::SwitchLiveTVRingBuffer()
     RecorderBase::CheckForRingBufferSwitch(void)
       DTVRecorder::ResetForNewFile() -> recorder's Reset() which calls
 DTVRecorder::Reset(), and also deletes the posmap for the curRecording
 from the DB. This is too early, wrong posmap.

 ... then back up in TuningRestartRecorder(void), after the curRecording
 has been set to the new one, we call

   recorder->Reset()

 Which for DTVRecorders means calling DTVRecorder::Reset(), and doing a
 full reset again. But the timing is better. :)

 So if DTVRecorder::ResetForNewFile() does nothing instead of calling
 Reset() it won't delete the posmap for the old curRecording and it won't
 duplicate recorder->Reset(). For the DTV Recorders that don't define a
 Reset() they will also benefit by getting only one DTVRecorder::Reset()
 called instead of two.

 I think livetv is the only place that DTVRecorder::ResetForNewFile() is
 ever used.

 Shane

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3963#comment:2>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list