2014-05-22, 23:27
(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.