Skip to content

Commit

Permalink
MP1-5224: TvServer: TvLibrary: Fix CancelTune request (remains perman…
Browse files Browse the repository at this point in the history
…ently set)
  • Loading branch information
epbk committed Jul 30, 2024
1 parent 58c9558 commit 02ef5a7
Showing 1 changed file with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,41 +319,44 @@ public virtual ITvSubChannel Tune(int subChannelId, IChannel channel)
}

private ITvSubChannel DoTune(int subChannelId, IChannel channel, bool ignorePMT)
{
bool performTune = (_previousChannel == null || _previousChannel.IsDifferentTransponder(channel));
ITvSubChannel ch = SubmitTuneRequest(subChannelId, channel, _tuneRequest, performTune);
_previousChannel = channel;

{
try
{
if (ch != null)
bool performTune = (_previousChannel == null || _previousChannel.IsDifferentTransponder(channel));
ITvSubChannel ch = SubmitTuneRequest(subChannelId, channel, _tuneRequest, performTune);
_previousChannel = channel;

try
{
try
if (ch != null)
{
RunGraph(ch.SubChannelId);
}
catch (TvExceptionNoPMT)
{
if (!ignorePMT)
try
{
RunGraph(ch.SubChannelId);
}
catch (TvExceptionNoPMT)
{
throw;
if (!ignorePMT)
{
throw;
}
}
OnAfterTune(channel);
return ch;
}
else
{
throw new TvException("TvCardDvbBase.Tune: Subchannel was null");
}
OnAfterTune(channel);
return ch;
}
else
{
throw new TvException("TvCardDvbBase.Tune: Subchannel was null");
}
}
catch (Exception)
{
if (ch != null)
catch (Exception)
{
FreeSubChannel(ch.SubChannelId);
if (ch != null)
{
FreeSubChannel(ch.SubChannelId);
}
throw;
}
throw;
}
finally
{
Expand Down Expand Up @@ -953,6 +956,7 @@ public override void StopGraph()
_epgGrabbing = false;
_isScanning = false;
FreeAllSubChannels();
_cancelTune = false;
if (_mdplugs != null)
{
_mdplugs.FreeAllChannels();
Expand Down

0 comments on commit 02ef5a7

Please sign in to comment.