eDebug("failed (%m)");
else
eDebug("ok");
- freeze();
-
+ freeze(); // why freeze here?!? this is a problem when only a pid change is requested... because of the unfreeze logic in Decoder::setState
eDebugNoNewLine("AUDIO_PLAY - ");
if (::ioctl(m_fd, AUDIO_PLAY) < 0)
eDebug("failed (%m)");
eDVBAudio::~eDVBAudio()
{
- unfreeze();
+ unfreeze(); // why unfreeze here... but not unfreeze video in ~eDVBVideo ?!?
if (m_fd >= 0)
::close(m_fd);
if (m_fd_demux >= 0)
return -errno;
}
eDebug("ok");
- freeze();
+ freeze(); // why freeze here?!? this is a problem when only a pid change is requested... because of the unfreeze logic in Decoder::setState
eDebugNoNewLine("VIDEO_PLAY - ");
if (::ioctl(m_fd, VIDEO_PLAY) < 0)
eDebug("failed (%m)");
return -errno;
}
eDebug("ok");
- eDebugNoNewLine("DEMUX_START - pcr - ");
+ eDebugNoNewLine("DEMUX_START - ttx - ");
if (::ioctl(m_fd_demux, DMX_START) < 0)
{
eDebug("failed(%m)");
if ((nott && m_text) || (!m_text && !nott))
m_changed |= changeText | changeState;
+ 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;
#if HAVE_DVB_API_VERSION < 3
bool checkAVSync = m_changed & (changeAudio|changeVideo|changePCR);
RESULT eTSMPEGDecoder::setVideoPID(int vpid, int type)
{
- if (m_vpid != vpid)
+ if ((m_vpid != vpid) || (m_vtype != type))
{
m_changed |= changeVideo;
m_vpid = vpid;
RESULT eTSMPEGDecoder::play()
{
if (m_state == statePlay)
- return 0;
- m_state = statePlay;
- m_changed |= changeState;
+ {
+ 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! */
+ {
+ m_state = statePlay;
+ m_changed |= changeState;
+ }
return setState();
}
unsigned char seq_end[] = { 0x00, 0x00, 0x01, 0xB7 };
unsigned char iframe[s.st_size];
unsigned char stuffing[8192];
+ int streamtype = VIDEO_STREAMTYPE_MPEG2;
memset(stuffing, 0, 8192);
read(f, iframe, s.st_size);
if (ioctl(m_video_clip_fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY) < 0)
eDebug("VIDEO_SELECT_SOURCE MEMORY failed (%m)");
+ if (ioctl(m_video_clip_fd, VIDEO_SET_STREAMTYPE, streamtype) < 0)
+ eDebug("VIDEO_SET_STREAMTYPE failed(%m)");
if (ioctl(m_video_clip_fd, VIDEO_PLAY) < 0)
eDebug("VIDEO_PLAY failed (%m)");
- if (::ioctl(m_video_clip_fd, VIDEO_CONTINUE) < 0)
+ if (ioctl(m_video_clip_fd, VIDEO_CONTINUE) < 0)
eDebug("video: VIDEO_CONTINUE: %m");
- if (::ioctl(m_video_clip_fd, VIDEO_CLEAR_BUFFER) < 0)
+ if (ioctl(m_video_clip_fd, VIDEO_CLEAR_BUFFER) < 0)
eDebug("video: VIDEO_CLEAR_BUFFER: %m");
while(pos <= (s.st_size-4) && !(seq_end_avail = (!iframe[pos] && !iframe[pos+1] && iframe[pos+2] == 1 && iframe[pos+3] == 0xB7)))
++pos;