X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ca329d3e86a98aacb0597d8581f5354cc99542e4..842dabf727814691bfd949ac4d910ce04c32b887:/lib/dvb/dvb.cpp diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 11b1285a..f8f5a378 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -685,13 +685,16 @@ void eDVBChannel::cueSheetEvent(int event) eDebug("skipmode ratio is %lld:90000, bitrate is %d bit/s", m_cue->m_skipmode_ratio, bitrate); /* i agree that this might look a bit like black magic. */ m_skipmode_n = 512*1024; /* must be 1 iframe at least. */ - m_skipmode_m = bitrate / 8 / 90000 * m_cue->m_skipmode_ratio; + m_skipmode_m = bitrate / 8 / 90000 * m_cue->m_skipmode_ratio / 8; + + if (m_cue->m_skipmode_ratio < 0) + m_skipmode_m -= m_skipmode_n; eDebug("resolved to: %d %d", m_skipmode_m, m_skipmode_n); if (abs(m_skipmode_m) < abs(m_skipmode_n)) { - eFatal("damn, something is wrong with this calculation"); + eWarning("something is wrong with this calculation"); m_skipmode_n = m_skipmode_m = 0; } @@ -766,8 +769,16 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off if (relative) { pts_t now; - /* we're using the decoder's timestamp here. this - won't work for radio (ouch). */ + if (!m_cue->m_decoder) + { + eDebug("no decoder - can't seek relative"); + continue; + } + if (m_cue->m_decoder->getPTS(0, now)) + { + eDebug("decoder getPTS failed, can't seek relative"); + continue; + } if (getCurrentPosition(m_cue->m_decoding_demux, now, 1)) { eDebug("seekTo: getCurrentPosition failed!"); @@ -997,15 +1008,19 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, in return -1; pts_t now; + int r; - /* TODO: this is a gross hack. */ - r = decoding_demux->getSTC(now, mode ? 128 : 0); - - if (r) + + if (mode == 0) /* demux */ { - eDebug("demux getSTC failed"); - return -1; - } + r = decoding_demux->getSTC(now, 0); + if (r) + { + eDebug("demux getSTC failed"); + return -1; + } + } else + now = pos; /* fixup supplied */ off_t off = 0; /* TODO: fixme */ r = m_tstools.fixupPTS(off, now); @@ -1088,9 +1103,10 @@ void eCueSheet::setSkipmode(const pts_t &ratio) m_event(evtSkipmode); } -void eCueSheet::setDecodingDemux(iDVBDemux *demux) +void eCueSheet::setDecodingDemux(iDVBDemux *demux, iTSMPEGDecoder *decoder) { m_decoding_demux = demux; + m_decoder = decoder; } RESULT eCueSheet::connectEvent(const Slot1 &event, ePtr &connection)