From a648830a100839cb95548cffe2a6cd291f8da19c Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 17 Aug 2010 10:18:13 +0200 Subject: Playback/Skipping fixes / cleanup by A. Holst * Jumping between marks in the movie, with "<" and ">", doesn't work well when there are cut marks in the movie. Especially jumping backwards will fail if there is a mark in a cut out region that is to be jumped over. (InfoBarGenerics.py, chunks 3 and 4) * Now when rewind works at all platforms also at low speeds, the rewind speeds x2 and x4 should be added again to the default. (UsageConfig.py, chunk 1) * Cleanup some obsolete code: SeekBackHack and non-smooth winding. None of these can be used anymore, but remnants were left in the code and in the configuration alternatives. It is high time to clean these out. (setup.xml, UsageConfig.py chunk 2, InfoBarGenerics.py chunks 1 and 2, DVDPlayer) * In the position gauge of the movie player, marks in the movie are shown as red dots. Long time ago the last position was also shown as a red dot, which was bad because it was confused with the marks, so it was removed. However, jumping between marks in the movie with "<" and ">" also stops at the last position, which is useful e.g. if you don't automatically start playing from the last position. The code below adds the last position back to the position gauge as a green dot, to distinguish it from the red ones. (epositiongauge.cpp) refs bug #570 --- lib/dvb/pvrparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dvb') diff --git a/lib/dvb/pvrparse.cpp b/lib/dvb/pvrparse.cpp index 5cdecbd6..e19dd1e4 100644 --- a/lib/dvb/pvrparse.cpp +++ b/lib/dvb/pvrparse.cpp @@ -123,7 +123,7 @@ void eMPEGStreamInformation::fixupDiscontinuties() pts_t current = i->second - currentDelta; pts_t diff = current - lastpts_t; - if (llabs(diff) > (90000*5)) // 5sec diff + if (llabs(diff) > (90000*10)) // 10sec diff { // eDebug("%llx < %llx, have discont. new timestamp is %llx (diff is %llx)!", current, lastpts_t, i->second, diff); currentDelta = i->second - lastpts_t; /* FIXME: should be the extrapolated new timestamp, based on the current rate */ -- cgit v1.2.3 From 16902de6f4215ccd425622b92e8ae6be1ae4a97f Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 27 Aug 2010 10:42:16 +0200 Subject: Another seek fix by Aholst from the enigma2-devel ml ------------------------------------------------------------------ And one more fix on this theme: rewind and higher than 8 times forward doesn't work for some movies. It turns out that when I and Felix communicated about the "accurate speed winding" that he eventually implemented, introducing the .sc files, we both made a false assumption (sorry if I lead you into it), that it was enough to jump to an I-frame picture start. However, it appears that (for an SD-movie that is) one should jump to the sequence start instead. (This is actually what the c++-code already does when dealing with the .ap-file, but not for the .sc) Since most movies have the sequence and picture start in the same ts-frame it usually doesn't matter. But there are movies out there with the sequence start in a ts-frame before the picture start, and for them rewind and very fast forward currently just freezes playback instead. The below patch fixes that. It just backs up through .sc to the previous sequence start once the picture start is found. Also, alignment has to be done here again and not in dvb.cpp, to get the right winding speed. Please ask me for the full technical details if something is unclear. ------------------------------------------------------------------ refs bug #570 --- lib/dvb/tstools.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/dvb') diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index d5ad2494..a0e4eb15 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -698,9 +698,23 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram else if (direction == +1) direction = 0; } - /* let's find the next frame after the given offset */ off_t start = offset; + /* backtrack to find the previous sequence start, in case of MPEG2 */ + if ((data & 0xFF) == 0x00) { + do { + --start; + if (m_streaminfo.getStructureEntry(start, data, 0)) + { + eDebug("get previous failed"); + return -1; + } + } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00) && ((data & 0xFF) != 0xB3)); /* sequence start or previous frame */ + if ((data & 0xFF) != 0xB3) + start = offset; /* Failed to find corresponding sequence start, so never mind */ + } + + /* let's find the next frame after the given offset */ do { if (m_streaminfo.getStructureEntry(offset, data, 1)) { @@ -716,8 +730,8 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00)); /* next frame */ /* align to TS pkt start */ -// start = start - (start % 188); -// offset = offset - (offset % 188); + start = start - (start % 188); + offset = offset - (offset % 188); len = offset - start; _offset = start; -- cgit v1.2.3