@@ -2648,6 +2648,7 @@ bool Scheduler::HandleRecording(
2648
2648
2649
2649
QDateTime curtime = MythDate::current ();
2650
2650
QDateTime nextrectime = ri.GetRecordingStartTime ();
2651
+ int origprerollseconds = prerollseconds;
2651
2652
2652
2653
if (ri.GetRecordingStatus () != RecStatus::WillRecord &&
2653
2654
ri.GetRecordingStatus () != RecStatus::Pending)
@@ -2819,21 +2820,18 @@ bool Scheduler::HandleRecording(
2819
2820
2820
2821
if (ri.GetRecordingStatus () != RecStatus::Pending)
2821
2822
{
2822
- if (m_sinputinfomap[ri. GetInputID ()]. m_schedgroup )
2823
+ if (! AssignGroupInput (tempri, origprerollseconds) )
2823
2824
{
2824
- if (!AssignGroupInput (tempri))
2825
- {
2826
- // We failed to assign an input. Keep asking the main
2827
- // server to add one until we get one.
2828
- MythEvent me (QString (" ADD_CHILD_INPUT %1" )
2829
- .arg (tempri.GetInputID ()));
2830
- gCoreContext ->dispatch (me);
2831
- nextWakeTime = min (nextWakeTime, curtime.addSecs (1 ));
2832
- return m_reclist_changed;
2833
- }
2834
- ri.SetInputID (tempri.GetInputID ());
2835
- nexttv = (*m_tvList)[ri.GetInputID ()];
2825
+ // We failed to assign an input. Keep asking the main
2826
+ // server to add one until we get one.
2827
+ MythEvent me (QString (" ADD_CHILD_INPUT %1" )
2828
+ .arg (tempri.GetInputID ()));
2829
+ gCoreContext ->dispatch (me);
2830
+ nextWakeTime = min (nextWakeTime, curtime.addSecs (1 ));
2831
+ return m_reclist_changed;
2836
2832
}
2833
+ ri.SetInputID (tempri.GetInputID ());
2834
+ nexttv = (*m_tvList)[ri.GetInputID ()];
2837
2835
2838
2836
ri.SetRecordingStatus (RecStatus::Pending);
2839
2837
tempri.SetRecordingStatus (RecStatus::Pending);
@@ -2928,7 +2926,8 @@ void Scheduler::HandleRecordingStatusChange(
2928
2926
}
2929
2927
}
2930
2928
2931
- bool Scheduler::AssignGroupInput (RecordingInfo &ri)
2929
+ bool Scheduler::AssignGroupInput (RecordingInfo &ri,
2930
+ int prerollseconds)
2932
2931
{
2933
2932
if (!m_sinputinfomap[ri.GetInputID ()].m_schedgroup )
2934
2933
return true ;
@@ -2956,7 +2955,8 @@ bool Scheduler::AssignGroupInput(RecordingInfo &ri)
2956
2955
for (RecIter j = m_reclist.begin (); j != m_reclist.end (); ++j)
2957
2956
{
2958
2957
RecordingInfo *p = (*j);
2959
- if (now.secsTo (p->GetRecordingStartTime ()) > 300 )
2958
+ if (now.secsTo (p->GetRecordingStartTime ()) >
2959
+ prerollseconds + 60 )
2960
2960
break ;
2961
2961
if (p->GetInputID () != inputid)
2962
2962
continue ;
0 commit comments