2012-09-30, 04:54
OK. I basically just moved the delay code out of the switch channel function and into the open stream function right before returning. It only gets executed if the recorder is null since there is no channel switch in between episodes on the same channel which is when the recorder would not be null. It gives me working tuning from both playing nothing and changing the channel while already watching live tv.
Code:
--- addons/pvr.cmyth/src/PVRcmyth.cpp
***************
*** 678,683 ****
--- 678,692 ----
}
if(m_rec.SpawnLiveTV(chan))
{
+ /* Delay channel switch before playback */
+ if (g_iPlayBackDelay > 0) {
+ int i = 0;
+ while (i<g_iPlayBackDelay) {
+ usleep(100000);
+ i += 100;
+ XBMC->Log(LOG_DEBUG,"%s: Delay channel switch: %d/%d",__FUNCTION__,i,g_iPlayBackDelay);
+ }
+ }
return true;
}
}
***************
*** 778,795 ****
}
if(g_bExtraDebug)
XBMC->Log(LOG_DEBUG,"%s - Done",__FUNCTION__);
-
- /* Delay channel switch before playback */
- // Need to Pause the recorder ?
- if (g_iPlayBackDelay > 0) {
- int i = 0;
- while (i<g_iPlayBackDelay) {
- usleep(100000);
- i += 100;
- XBMC->Log(LOG_DEBUG,"%s: Delay channel switch: %d/%d",__FUNCTION__,i,g_iPlayBackDelay);
- }
- }
-
return retval;
}
--- 787,792 ----