diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-06-12 00:21:33 +0200 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-06-12 00:21:33 +0200 |
| commit | 5a6713898cddeded5fc88d7316861d88400f57f1 (patch) | |
| tree | d38166b269f59e63631eaadee30efb66838ee3c1 /lib/service | |
| parent | 1a2b0a4379ee3e9d16108c52abdadc9bb85675c1 (diff) | |
| parent | 2d03f14ca12ee50e2dac8b97b1a54e681dc86cef (diff) | |
| download | enigma2-5a6713898cddeded5fc88d7316861d88400f57f1.tar.gz enigma2-5a6713898cddeded5fc88d7316861d88400f57f1.zip | |
Merge branch 'master' of /home/tmbinc/enigma2-git
Diffstat (limited to 'lib/service')
| -rw-r--r-- | lib/service/servicedvb.cpp | 18 | ||||
| -rw-r--r-- | lib/service/servicemp3.cpp | 18 | ||||
| -rw-r--r-- | lib/service/servicemp3.h | 5 |
3 files changed, 24 insertions, 17 deletions
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index bd15bcdc..c256213d 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -2826,18 +2826,22 @@ void eDVBServicePlay::checkSubtitleTiming() m_decoder->getPTS(0, pos); eDebug("%lld %lld", pos, show_time); - int diff = show_time - pos; + int diff = show_time - pos; + if (type == TELETEXT && !page.m_have_pts) + { + eDebug("ttx subtitle page without pts... immediate show"); + diff = 0; + } if (diff < 0) { eDebug("[late (%d ms)]", -diff / 90); diff = 0; } -// if (diff > 900000) -// { -// eDebug("[invalid]"); -// diff = 0; -// } - + if (abs(diff) > 1800000) + { + eDebug("[invalid]... immediate show!"); + diff = 0; + } if ((diff/90)<20) { if (type == TELETEXT) diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 2ddfe925..77501e75 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -69,7 +69,7 @@ DEFINE_REF(eServiceFactoryMP3) RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr) { // check resources... - ptr = new eServiceMP3(ref.path.c_str(),ref.getName().c_str()); + ptr = new eServiceMP3(ref); return 0; } @@ -187,7 +187,8 @@ int eStaticServiceMP3Info::getLength(const eServiceReference &ref) // eServiceMP3 -eServiceMP3::eServiceMP3(const char *filename, const char *title): m_filename(filename), m_title(title), m_pump(eApp, 1) +eServiceMP3::eServiceMP3(eServiceReference ref) + :m_ref(ref), m_pump(eApp, 1) { m_seekTimeout = eTimer::create(eApp); m_subtitle_sync_timer = eTimer::create(eApp); @@ -204,7 +205,8 @@ eServiceMP3::eServiceMP3(const char *filename, const char *title): m_filename(fi m_state = stIdle; eDebug("eServiceMP3::construct!"); - + + const char *filename = m_ref.path.c_str(); const char *ext = strrchr(filename, '.'); if (!ext) ext = filename; @@ -379,7 +381,7 @@ RESULT eServiceMP3::stop() ASSERT(m_state != stIdle); if (m_state == stStopped) return -1; - eDebug("eServiceMP3::stop %s", m_filename.c_str()); + eDebug("eServiceMP3::stop %s", m_ref.path.c_str()); gst_element_set_state(m_gst_playbin, GST_STATE_NULL); m_state = stStopped; return 0; @@ -596,15 +598,16 @@ RESULT eServiceMP3::info(ePtr<iServiceInformation>&i) RESULT eServiceMP3::getName(std::string &name) { - if (m_title.empty()) + std::string title = m_ref.getName(); + if (title.empty()) { - name = m_filename; + name = m_ref.path; size_t n = name.rfind('/'); if (n != std::string::npos) name = name.substr(n + 1); } else - name = m_title; + name = title; return 0; } @@ -615,6 +618,7 @@ int eServiceMP3::getInfo(int w) switch (w) { + case sServiceref: return m_ref; case sVideoHeight: return m_height; case sVideoWidth: return m_width; case sFrameRate: return m_framerate; diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index 1d77483f..ee06064a 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -176,11 +176,10 @@ private: ePtr<eTimer> m_seekTimeout; void seekTimeoutCB(); friend class eServiceFactoryMP3; - std::string m_filename; - std::string m_title; + eServiceReference m_ref; int m_buffer_size; bufferInfo m_bufferInfo; - eServiceMP3(const char *filename, const char *title); + eServiceMP3(eServiceReference ref); Signal2<void,iPlayableService*,int> m_event; enum { |
