Skip to content

Commit

Permalink
[Fixed] Recordings of stream relay channels not working
Browse files Browse the repository at this point in the history
(cherry picked from commit e8573b22b45b7b1466e69c06983bc614541ab3d8)
  • Loading branch information
DimitarCC authored and teamblue-e2 committed Dec 21, 2023
1 parent 6daeaac commit f3a54c0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
37 changes: 36 additions & 1 deletion lib/dvb/pmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,11 @@ int eDVBServicePMTHandler::compareAudioSubtitleCode(const std::string &subtitleT

int eDVBServicePMTHandler::getChannel(eUsePtr<iDVBChannel> &channel)
{
channel = m_channel;
if (m_sr_channel) {
channel = m_sr_channel;
} else {
channel = m_channel;
}
if (channel)
return 0;
else
Expand Down Expand Up @@ -1121,6 +1125,37 @@ int eDVBServicePMTHandler::tuneExt(eServiceReferenceDVB &ref, ePtr<iTsSource> &s

if (!simulate)
{
// If is stream relay service then allocate the real channel so to provide correct frontend info
std::string s_ref = ref.toString();
eDVBChannelID chid;
std::string sr_url = eConfigManager::getConfigValue("config.misc.softcam_streamrelay_url");
sr_url = replace_all(replace_all(replace_all(sr_url, "[", ""), "]", ""), ", ", ".");
std::string sr_port = eConfigManager::getConfigValue("config.misc.softcam_streamrelay_port");
if (s_ref.find(sr_url + "%3a" + sr_port) != std::string::npos) {
std::vector<std::string> s_split = split(s_ref, ":");
std::string url_sr = s_split[s_split.size() - 2];
std::vector<std::string> sr_split = split(url_sr, "/");
std::string ref_orig = sr_split.back();
ref_orig = replace_all(ref_orig, "%3a", ":");
eServiceReferenceDVB newRef = eServiceReferenceDVB(ref_orig);
newRef.getChannelID(chid);
// Allocate the channel in different ptr so to not mess up original pvr channel info
res = m_resourceManager->allocateChannel(chid, m_sr_channel, simulate);
}


if (m_sr_channel) {
m_sr_channel->connectStateChange(
sigc::mem_fun(*this, &eDVBServicePMTHandler::channelStateChanged),
m_channelStateChanged_connection);
m_last_channel_state = -1;
channelStateChanged(m_sr_channel);

m_sr_channel->connectEvent(
sigc::mem_fun(*this, &eDVBServicePMTHandler::channelEvent),
m_channelEvent_connection);
}

if (m_channel)
{
m_channel->connectStateChange(
Expand Down
1 change: 1 addition & 0 deletions lib/dvb/pmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class eDVBServicePMTHandler: public eDVBPMTParser
eAUTable<eTable<OCSection> > m_OC;

eUsePtr<iDVBChannel> m_channel;
eUsePtr<iDVBChannel> m_sr_channel;
eUsePtr<iDVBPVRChannel> m_pvr_channel;
ePtr<eDVBResourceManager> m_resourceManager;
ePtr<iDVBDemux> m_demux, m_pvr_demux_tmp;
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/ServiceName.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def getText(self):
text = property(getText)

def changed(self, what):
if what[0] != self.CHANGED_SPECIFIC or what[1] in (iPlayableService.evStart,):
if what[0] != self.CHANGED_SPECIFIC or what[1] in (iPlayableService.evStart, iPlayableService.evNewProgramInfo):
Converter.changed(self, what)

def getName(self, ref, info):
Expand Down

0 comments on commit f3a54c0

Please sign in to comment.