X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/156d69e7c1fcdea9c26c33240a8ae9e3c059cce7..f769a73f621f88d4b4e64be8fae3f79ca3ef6c1b:/lib/dvb/decoder.cpp diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp index 511f91de..57f48ee3 100644 --- a/lib/dvb/decoder.cpp +++ b/lib/dvb/decoder.cpp @@ -282,9 +282,8 @@ void eDVBAudio::setChannel(int channel) int eDVBAudio::getPTS(pts_t &now) { - eDebugNoNewLine("AUDIO_GET_PTS - "); if (::ioctl(m_fd, AUDIO_GET_PTS, &now) < 0) - eDebug("failed (%m)"); + eDebug("AUDIO_GET_PTS failed (%m)"); return 0; } @@ -564,6 +563,20 @@ void eDVBVideo::video_event(int) event.width = evt.u.size.w; /* emit */ m_event(event); } + else if (evt.type == VIDEO_EVENT_FRAME_RATE_CHANGED) + { + struct iTSMPEGDecoder::videoEvent event; + event.type = iTSMPEGDecoder::videoEvent::eventFrameRateChanged; + event.framerate = evt.u.frame_rate; + /* emit */ m_event(event); + } + else if (evt.type == 16 /*VIDEO_EVENT_PROGRESSIVE_CHANGED*/) + { + struct iTSMPEGDecoder::videoEvent event; + event.type = iTSMPEGDecoder::videoEvent::eventProgressiveChanged; + event.progressive = evt.u.frame_rate; + /* emit */ m_event(event); + } else eDebug("unhandled DVBAPI Video Event %d", evt.type); } @@ -1146,7 +1159,7 @@ RESULT eTSMPEGDecoder::showSinglePic(const char *filename) { eDebug("showSinglePic %s", filename); int f = open(filename, O_RDONLY); - if (f) + if (f >= 0) { struct stat s; fstat(f, &s); @@ -1174,6 +1187,8 @@ RESULT eTSMPEGDecoder::showSinglePic(const char *filename) ++pos; if ((iframe[3] >> 4) != 0xE) // no pes header write(m_video_clip_fd, pes_header, sizeof(pes_header)); + else + iframe[4] = iframe[5] = 0x00; write(m_video_clip_fd, iframe, s.st_size); if (!seq_end_avail) write(m_video_clip_fd, seq_end, sizeof(seq_end));