servicedvb.cpp: fix "some seconds no audio after audio track change on TS Playback"
[enigma2.git] / lib / service / servicedvb.cpp
index a3e479bf9db60383c1f61d18dba5124a07572a4c..b71271a9add4211c8c612629beaf88ab7863d288 100644 (file)
@@ -1279,9 +1279,10 @@ RESULT eDVBServicePlay::getLength(pts_t &len)
 RESULT eDVBServicePlay::pause()
 {
        eDebug("eDVBServicePlay::pause");
-       setFastForward_internal(0);
+       setFastForward_internal(0, m_slowmotion || m_fastforward > 1);
        if (m_decoder)
        {
+               m_slowmotion = 0;
                m_is_paused = 1;
                return m_decoder->pause();
        } else
@@ -1742,6 +1743,7 @@ int eDVBServicePlay::selectAudioStream(int i)
 {
        eDVBServicePMTHandler::program program;
        eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler;
+       pts_t position = -1;
 
        if (h.getProgramInfo(program))
                return -1;
@@ -1764,6 +1766,9 @@ int eDVBServicePlay::selectAudioStream(int i)
                apidtype = program.audioStreams[stream].type;
        }
 
+       if (i != -1 && apid != m_current_audio_pid && (m_is_pvr || m_timeshift_active))
+               eDebug("getPlayPosition ret %d, pos %lld in selectAudioStream", getPlayPosition(position), position);
+
        m_current_audio_pid = apid;
 
        if (m_is_primary && m_decoder->setAudioPID(apid, apidtype))
@@ -1772,6 +1777,9 @@ int eDVBServicePlay::selectAudioStream(int i)
                return -4;
        }
 
+       if (position != -1)
+               eDebug("seekTo ret %d", seekTo(position));
+
        int rdsPid = apid;
 
                /* if we are not in PVR mode, timeshift is not active and we are not in pip mode, check if we need to enable the rds reader */