Open spdfrk opened 3 weeks ago
Well the above works pretty well but small adjustment needed to prevent the stream from resetting when it's closing down.
/* Drop packets for unknown streams */
if (m_streamStat.find(idx) == m_streamStat.end())
{
if(m_streamStat.size() > 0) {
Logger::Log(LogLevel::LEVEL_DEBUG, "Dropped packet with unknown stream index %i", idx);
m_conn.Disconnect();
}
Tried also this as a test but somehow I end up with a 5 second delay on the video side which Kodi does not resync. Opening a second video player in parallel with the same stream shows the stream itself is actually ok. Or I think, not really sure how Tvheadend handles a second client on the same channel.
if(idx == 1003) {
m_streamStat[idx] = 0;
kodi::addon::PVRCodec codec = m_demuxPktHdl.GetCodecByName("AC3");
kodi::addon::PVRStreamProperties stream;
stream.SetCodecType(codec.GetCodecType());
stream.SetCodecId(codec.GetCodecId());
stream.SetPID(idx);
stream.SetChannels(6);
stream.SetSampleRate(48000);
m_streams.emplace_back(std::move(stream));
DEMUX_PACKET* pkt = m_demuxPktHdl.AllocateDemuxPacket(0);
pkt->iStreamId = DEMUX_SPECIALID_STREAMCHANGE;
m_pktBuffer.Push(pkt);
}
Anyway, not really sure yet how to proceed. Some input would be welcome!
Hi,
I'm running into an issue where sometimes the audio streams are not available yet on subscription (HTSP). This seams to be specifically HTSP as HTTP mode works but not really an option. The issue can happen randomly for any stream, restarting the stream most of the time fixes it. The streams are DASH streams piped through ffmpeg.
On Tvheadend side I can see below warnings when the audio is missing: tsfix: The timediff for AC3 is big (.....), using current dts tsfix: The timediff for AAC is big (.....), using current dts
Alternatively sometimes only AC3 is missing.
Kodi log when working ok:
Not ok:
Now the log spam from Kodi starts with:
As a quick fix I just reset the stream like this. Although I think somehow adding the streams would be a lot better. https://github.com/kodi-pvr/pvr.hts/blob/Piers/src/tvheadend/HTSPDemuxer.cpp#L547
Do you think this is something that can be fixed on the plugin side? Thanks!