From 856f22dbf1ac274210ba5d4e12d7a5090fda1c94 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 30 Jul 2005 10:04:18 +0200 Subject: [PATCH] cDvbPlayer::Goto() now appends a Sequence End Code to get the image shown immediately with softdevices --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ dvbplayer.c | 27 +++++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 45a446b2..683dcdaa 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -961,6 +961,8 @@ Reinhard Nissl for implementing cVideoRepacker in remux.c to make sure every PES packet contains only data from one frame for fixing the call to Channels.Unlock() in cEITScanner::Process() + for making cDvbPlayer::Goto() append a Sequence End Code to get the image shown + immediately with softdevices Richard Robson for reporting freezing replay if a timer starts while in Transfer Mode from the diff --git a/HISTORY b/HISTORY index 6777ba1e..c1cde750 100644 --- a/HISTORY +++ b/HISTORY @@ -3640,3 +3640,5 @@ Video Disk Recorder Revision History device, which avoids a busy loop on very fast machines (thanks to Martin Wache). - Modified the description of cDevice::Poll() to avoid misunderstandings. - Updated Croatian language texts (thanks to Drazen Dupor). +- cDvbPlayer::Goto() now appends a Sequence End Code to get the image shown + immediately with softdevices (thanks to Reinhard Nissl). diff --git a/dvbplayer.c b/dvbplayer.c index 3082e281..cd002a77 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 1.35 2005/07/30 09:20:08 kls Exp $ + * $Id: dvbplayer.c 1.36 2005/07/30 10:00:24 kls Exp $ */ #include "dvbplayer.h" @@ -668,11 +668,34 @@ void cDvbPlayer::Goto(int Index, bool Still) int FileOffset, Length; Index = index->GetNextIFrame(Index, false, &FileNumber, &FileOffset, &Length); if (Index >= 0 && NextFile(FileNumber, FileOffset) && Still) { - uchar b[MAXFRAMESIZE]; + uchar b[MAXFRAMESIZE + 4 + 5 + 4]; int r = ReadFrame(replayFile, b, Length, sizeof(b)); if (r > 0) { if (playMode == pmPause) DevicePlay(); + // append sequence end code to get the image shown immediately with softdevices + if (r > 6) { // should be always true + b[r++] = 0x00; + b[r++] = 0x00; + b[r++] = 0x01; + b[r++] = b[3]; + if (b[6] & 0x80) { // MPEG 2 + b[r++] = 0x00; + b[r++] = 0x07; + b[r++] = 0x80; + b[r++] = 0x00; + b[r++] = 0x00; + } + else { // MPEG 1 + b[r++] = 0x00; + b[r++] = 0x05; + b[r++] = 0x0F; + } + b[r++] = 0x00; + b[r++] = 0x00; + b[r++] = 0x01; + b[r++] = 0xB7; + } DeviceStillPicture(b, r); } playMode = pmStill;