#define dmxPesFilterParams dmx_pes_filter_params
#define DMX_PES_VIDEO0 DMX_PES_VIDEO
#define DMX_PES_AUDIO0 DMX_PES_AUDIO
+#define DMX_PES_PCR0 DMX_PES_PCR
+#define DMX_PES_TELETEXT0 DMX_PES_TELETEXT
#define DMX_PES_VIDEO1 DMX_PES_VIDEO
#define DMX_PES_AUDIO1 DMX_PES_AUDIO
+#define DMX_PES_PCR1 DMX_PES_PCR
+#define DMX_PES_TELETEXT1 DMX_PES_TELETEXT
#include <ost/dmx.h>
#include <ost/video.h>
#include <ost/audio.h>
case aAACHE:
bypass = 9;
break;
+ case aLPCM:
+ bypass = 6;
+ break;
}
eDebugNoNewLine("AUDIO_SET_BYPASS(%d) - ", bypass);
void eDVBAudio::stop()
{
-#if HAVE_DVB_API_VERSION > 2
- flush();
-#endif
eDebugNoNewLine("AUDIO_STOP - ");
if (::ioctl(m_fd, AUDIO_STOP) < 0)
eDebug("failed (%m)");
return 0;
}
-static int readMpegProc(char *str, int decoder)
+static int readMpegProc(const char *str, int decoder)
{
int val = -1;
char tmp[64];
DEFINE_REF(eDVBPCR);
-eDVBPCR::eDVBPCR(eDVBDemux *demux): m_demux(demux)
+eDVBPCR::eDVBPCR(eDVBDemux *demux, int dev): m_demux(demux), m_dev(dev)
{
char filename[128];
#if HAVE_DVB_API_VERSION < 3
pes.pid = pid;
pes.input = DMX_IN_FRONTEND;
pes.output = DMX_OUT_DECODER;
- pes.pes_type = DMX_PES_PCR;
+ pes.pes_type = m_dev ? DMX_PES_PCR1 : DMX_PES_PCR0; /* FIXME */
pes.flags = 0;
eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - pcr - ", pid);
if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
DEFINE_REF(eDVBTText);
-eDVBTText::eDVBTText(eDVBDemux *demux): m_demux(demux)
+eDVBTText::eDVBTText(eDVBDemux *demux, int dev)
+ :m_demux(demux), m_dev(dev)
{
char filename[128];
#if HAVE_DVB_API_VERSION < 3
pes.pid = pid;
pes.input = DMX_IN_FRONTEND;
pes.output = DMX_OUT_DECODER;
- pes.pes_type = DMX_PES_TELETEXT;
+ pes.pes_type = m_dev ? DMX_PES_TELETEXT1 : DMX_PES_TELETEXT0; // FIXME
pes.flags = 0;
eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - ttx - ", pid);
return -errno;
}
eDebug("ok");
- eDebugNoNewLine("DEMUX_START - pcr - ");
+ eDebugNoNewLine("DEMUX_START - ttx - ");
if (::ioctl(m_fd_demux, DMX_START) < 0)
{
eDebug("failed(%m)");
const char *decoder_states[] = {"stop", "pause", "play", "decoderfastforward", "trickmode", "slowmotion"};
eDebug("decoder state: %s, vpid=%d, apid=%d", decoder_states[m_state], m_vpid, m_apid);
- bool changed = !!m_changed;
+ int changed = m_changed;
#if HAVE_DVB_API_VERSION < 3
bool checkAVSync = m_changed & (changeAudio|changeVideo|changePCR);
if (m_changed & changeAudio && m_audio)
}
if (m_changed & changePCR)
{
- m_pcr = new eDVBPCR(m_demux);
+ m_pcr = new eDVBPCR(m_demux, m_decoder);
if (m_pcr->setPid(m_pcrpid))
res = -1;
}
{
if ((m_pcrpid >= 0) && (m_pcrpid < 0x1FFF))
{
- m_pcr = new eDVBPCR(m_demux);
+ m_pcr = new eDVBPCR(m_demux, m_decoder);
if (m_pcr->startPid(m_pcrpid))
res = -1;
}
{
if ((m_textpid >= 0) && (m_textpid < 0x1FFF) && !nott)
{
- m_text = new eDVBTText(m_demux);
+ m_text = new eDVBTText(m_demux, m_decoder);
if (m_text->startPid(m_textpid))
res = -1;
}
}
#endif
- if (m_changed & changeState)
+ if (changed & (changeState|changeVideo|changeAudio))
{
/* play, slowmotion, fast-forward */
int state_table[6][4] =
/* [stateSlowMotion] = */ {1, m_ff_sm_ratio, 0}
};
int *s = state_table[m_state];
- if (m_video)
+ if (changed & (changeState|changeVideo) && m_video)
{
m_video->setSlowMotion(s[1]);
m_video->setFastForward(s[2]);
else
m_video->freeze();
}
- if (m_audio)
+ if (changed & (changeState|changeAudio) && m_audio)
{
if (s[0])
m_audio->unfreeze();
int eTSMPEGDecoder::m_pcm_delay=-1,
eTSMPEGDecoder::m_ac3_delay=-1;
-RESULT eTSMPEGDecoder::setPCMDelay(int delay)
+RESULT eTSMPEGDecoder::setHwPCMDelay(int delay)
{
- if (m_decoder == 0 && delay != m_pcm_delay )
+ if (delay != m_pcm_delay )
{
FILE *fp = fopen("/proc/stb/audio/audio_delay_pcm", "w");
if (fp)
return -1;
}
-RESULT eTSMPEGDecoder::setAC3Delay(int delay)
+RESULT eTSMPEGDecoder::setHwAC3Delay(int delay)
{
- if ( m_decoder == 0 && delay != m_ac3_delay )
+ if ( delay != m_ac3_delay )
{
FILE *fp = fopen("/proc/stb/audio/audio_delay_bitstream", "w");
if (fp)
return -1;
}
+
+RESULT eTSMPEGDecoder::setPCMDelay(int delay)
+{
+ return m_decoder == 0 ? setHwPCMDelay(delay) : -1;
+}
+
+RESULT eTSMPEGDecoder::setAC3Delay(int delay)
+{
+ return m_decoder == 0 ? setHwAC3Delay(delay) : -1;
+}
+
eTSMPEGDecoder::eTSMPEGDecoder(eDVBDemux *demux, int decoder)
: m_demux(demux),
m_vpid(-1), m_vtype(-1), m_apid(-1), m_atype(-1), m_pcrpid(-1), m_textpid(-1),
{
if (!m_changed)
return 0;
- }
-// else
-/* commented out because the changeState is needed to unfreeze decoders in decoder::setState... needed by normal pmt changes
-tmbinc please recheck this! */
+ } else
{
m_state = statePlay;
m_changed |= changeState;