Linux 5 minutes xbmc deadlock with vuplus & dm800 after switching on encrypted channel
#16
(2014-05-21, 23:27)lhooq Wrote: First at all, sorry for my english.

The problem with channels with shared pmt is that ffmpeg tries to demux an incorrect program (service id). The PMT includes all programs of the transponder, but the current version of dvdplayer always use the first program of PMT, so it can play only one channel of the transporder. I have done a small modification in DVDDemuxFFmpeg.cpp in order to select the correct program using the service id included in the URL.

I have tested it in mac OSX and it works (Live TV directly or m3u file). I don't know if this modification causes problems to other add-ons.

Code:
@@ -51,6 +51,7 @@
#include "utils/StringUtils.h"
#include "URL.h"
#include "cores/FFmpeg.h"
+#include "filesystem/PVRFile.h"

void CDemuxStreamAudioFFmpeg::GetStreamInfo(std::string& strInfo)
{
@@ -958,6 +959,49 @@
     else
       m_program = UINT_MAX;

+      //in case of m_program = UINT_MAX and all programs have the same pmt_id we have to select the correct program using the filename (http://host:port//service_reference)
+      
+      if (m_program == UINT_MAX && m_pFormatContext->nb_programs>1)
+      {
+          int pmt_shared=m_pFormatContext->programs[0]->pmt_pid;
+          unsigned int i;
+          for ( i=1; i<m_pFormatContext->nb_programs; i++) {
+              if (m_pFormatContext->programs[i]->pmt_pid!=pmt_shared) break;
+          }
+          if (i == m_pFormatContext->nb_programs) {
+              //This is a stream with shared pmt
+              CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::CreateStreams (%s)", m_pFormatContext->filename);
+              CStdString *strurl;
+              std::string transFile = XFILE::CPVRFile::TranslatePVRFilename(m_pFormatContext->filename);
+              if(transFile.substr(0, 6) != "")
+              {
+                  strurl= new CStdString(transFile.c_str());
+              }
+              else
+              {
+                  strurl= new CStdString(m_pFormatContext->filename);
+              }
+              
+              CURL nom (*strurl);
+              
+              CStdString reference=nom.GetFileName();
+              std::vector<std::string> tokens;
+              StringUtils::Tokenize(reference, tokens, ":");
+              int service;
+              sscanf(tokens[3].c_str(),"%x",&service);
+              
+              //search program index with this service
+              for ( i=0; i<m_pFormatContext->nb_programs; i++) {
+                  if (m_pFormatContext->programs[i]->id==service) break;
+              }
+              
+              if (i<m_pFormatContext->nb_programs)
+                  m_program=i;
+          }
+      }
+      
+
+      
     // look for first non empty stream and discard nonselected programs
     for (unsigned int i = 0; i < m_pFormatContext->nb_programs; i++)
     {

I supose that it isn't a "clean" solution, but it works.

Regards.

First, THANKS for your work.
I hope you've found the solution. A year trying everything without success.

Can not wait to try your suggestion but I don't have OSX. I run XBMC in iOS, ATV2, Android or Windows. Could you tell me where to find the file DVDDemuxFFmpeg to edit it ?

Thanks.
Reply
#17
If you have the XBMC source code the file DVDDemuxFFmpeg.cpp is in the path xbmc/cores/dvdplayer/DVDDemuxers. You have to generarte a new XBMC for your operating system.
Reply
#18
Freshly compiled Helix master 3d44377 with this patch. Might as well share and get feedback from other users.

For Windows ----> XBMCSetup-20140523-3d44377-master.exe

I'll compile for RPi later today and post a link.

Please backup your .xbmc folder before testing. This is bleeding edge software. If your data gets chewed it's not my fault.

BR,

hudo
Reply
#19
(2014-05-23, 11:48)lhooq Wrote: If you have the XBMC source code the file DVDDemuxFFmpeg.cpp is in the path xbmc/cores/dvdplayer/DVDDemuxers. You have to generarte a new XBMC for your operating system.
I've tried to compile XBMC for ios/atv2 but unfortunately I can't it.
I don't have Mac and OSX running on VMWare get constant errors when I try to download the sources or install cross libs and runtime environment.

(2014-05-23, 16:20)hudo Wrote: Freshly compiled Helix master 3d44377 with this patch. Might as well share and get feedback from other users.

For Windows ----> XBMCSetup-20140523-3d44377-master.exe

I'll compile for RPi later today and post a link.

Please backup your .xbmc folder before testing. This is bleeding edge software. If your data gets chewed it's not my fault.

BR,

hudo
I've tested your compilation in Windows 7 doing a clean install but doesn't work with encrypted channels.
When I try to open one of them the "working" message appears and not even get the message "buffering". Occurs even in the few encrypted channels that did work fine before.
The fta channels work fine.

Thank you both again.
Reply
#20
Please, could you upload a patched version of DVDDemuxFFmpeg.cpp ready to be compiled?
I've tried to compile an IOS and ATV2 build for my devices but always I get an error in the first line

(2014-05-21, 23:27)lhooq Wrote:
Code:
@@ -51,6 +51,7 @@
#include "utils/StringUtils.h"
#include "URL.h"
#include "cores/FFmpeg.h"
+#include "filesystem/PVRFile.h"
.
.
.

Thanks.
Reply
#21
(2014-05-22, 23:27)rivo Wrote:
(2014-05-21, 23:27)lhooq Wrote: First at all, sorry for my english.

The problem with channels with shared pmt is that ffmpeg tries to demux an incorrect program (service id). The PMT includes all programs of the transponder, but the current version of dvdplayer always use the first program of PMT, so it can play only one channel of the transporder. I have done a small modification in DVDDemuxFFmpeg.cpp in order to select the correct program using the service id included in the URL.

I have tested it in mac OSX and it works (Live TV directly or m3u file). I don't know if this modification causes problems to other add-ons.

Code:
@@ -51,6 +51,7 @@
#include "utils/StringUtils.h"
#include "URL.h"
#include "cores/FFmpeg.h"
+#include "filesystem/PVRFile.h"

void CDemuxStreamAudioFFmpeg::GetStreamInfo(std::string& strInfo)
{
@@ -958,6 +959,49 @@
     else
       m_program = UINT_MAX;

+      //in case of m_program = UINT_MAX and all programs have the same pmt_id we have to select the correct program using the filename (http://host:port//service_reference)
+      
+      if (m_program == UINT_MAX && m_pFormatContext->nb_programs>1)
+      {
+          int pmt_shared=m_pFormatContext->programs[0]->pmt_pid;
+          unsigned int i;
+          for ( i=1; i<m_pFormatContext->nb_programs; i++) {
+              if (m_pFormatContext->programs[i]->pmt_pid!=pmt_shared) break;
+          }
+          if (i == m_pFormatContext->nb_programs) {
+              //This is a stream with shared pmt
+              CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::CreateStreams (%s)", m_pFormatContext->filename);
+              CStdString *strurl;
+              std::string transFile = XFILE::CPVRFile::TranslatePVRFilename(m_pFormatContext->filename);
+              if(transFile.substr(0, 6) != "")
+              {
+                  strurl= new CStdString(transFile.c_str());
+              }
+              else
+              {
+                  strurl= new CStdString(m_pFormatContext->filename);
+              }
+              
+              CURL nom (*strurl);
+              
+              CStdString reference=nom.GetFileName();
+              std::vector<std::string> tokens;
+              StringUtils::Tokenize(reference, tokens, ":");
+              int service;
+              sscanf(tokens[3].c_str(),"%x",&service);
+              
+              //search program index with this service
+              for ( i=0; i<m_pFormatContext->nb_programs; i++) {
+                  if (m_pFormatContext->programs[i]->id==service) break;
+              }
+              
+              if (i<m_pFormatContext->nb_programs)
+                  m_program=i;
+          }
+      }
+      
+
+      
     // look for first non empty stream and discard nonselected programs
     for (unsigned int i = 0; i < m_pFormatContext->nb_programs; i++)
     {

I supose that it isn't a "clean" solution, but it works.

Regards.

First, THANKS for your work.
I hope you've found the solution. A year trying everything without success.

Can not wait to try your suggestion but I don't have OSX. I run XBMC in iOS, ATV2, Android or Windows. Could you tell me where to find the file DVDDemuxFFmpeg to edit it ?

Thanks.
Is there a possiblity to implement this workaround in 16.2 or 17 ?
Reply
#22
Made a more generic patch that fix this:
https://forum.kodi.tv/showthread.php?tid=319632
Reply

Logout Mark Read Team Forum Stats Members Help
5 minutes xbmc deadlock with vuplus & dm800 after switching on encrypted channel1