1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Keeping subtitles visible when pausing replay

This commit is contained in:
Klaus Schmidinger 2010-02-07 12:08:13 +01:00
parent 184db9ec8a
commit 978807e4d1
5 changed files with 52 additions and 40 deletions

View File

@ -1091,6 +1091,7 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for a patch that was used to implement handling the "component descriptor" ("genre") for a patch that was used to implement handling the "component descriptor" ("genre")
for a patch that was used to implement handling the "parental rating descriptor" for a patch that was used to implement handling the "parental rating descriptor"
suggesting to add plain text error messages to log entries from cOsd::SetAreas() suggesting to add plain text error messages to log entries from cOsd::SetAreas()
for keeping subtitles visible when pausing replay
Ralf Klueber <ralf.klueber@vodafone.com> Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark for reporting a bug in cutting a recording if there is only a single editing mark

View File

@ -6309,7 +6309,7 @@ Video Disk Recorder Revision History
- The files "commands.conf" and "reccmd.conf" can now contain nested lists of - The files "commands.conf" and "reccmd.conf" can now contain nested lists of
commands. See vdr.5 for information about the new file format. commands. See vdr.5 for information about the new file format.
2010-02-06: Version 1.7.13 2010-02-07: Version 1.7.13
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Changed the position of Sirius 4 to S4.8E in sources.conf (thanks to Alexander Gross). - Changed the position of Sirius 4 to S4.8E in sources.conf (thanks to Alexander Gross).
@ -6352,3 +6352,4 @@ Video Disk Recorder Revision History
------------------------------------------------------------ ------------------------------------------------------------
- Added device definitions to the diseqc.conf file format, so that certain satellite - Added device definitions to the diseqc.conf file format, so that certain satellite
positions can be limited to a given list of devices. positions can be limited to a given list of devices.
- Keeping subtitles visible when pausing replay (thanks to Rolf Ahrenberg).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 2.34 2010/02/06 14:34:18 kls Exp $ * $Id: device.c 2.35 2010/02/07 11:54:42 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -1053,11 +1053,15 @@ void cDevice::Clear(void)
void cDevice::Play(void) void cDevice::Play(void)
{ {
Audios.MuteAudio(mute); Audios.MuteAudio(mute);
if (dvbSubtitleConverter)
dvbSubtitleConverter->Freeze(false);
} }
void cDevice::Freeze(void) void cDevice::Freeze(void)
{ {
Audios.MuteAudio(true); Audios.MuteAudio(true);
if (dvbSubtitleConverter)
dvbSubtitleConverter->Freeze(true);
} }
void cDevice::Mute(void) void cDevice::Mute(void)

View File

@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de> * Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
* *
* $Id: dvbsubtitle.c 2.3 2009/12/05 16:11:54 kls Exp $ * $Id: dvbsubtitle.c 2.4 2010/02/07 12:08:13 kls Exp $
*/ */
#include "dvbsubtitle.h" #include "dvbsubtitle.h"
@ -658,6 +658,7 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void)
{ {
dvbSubtitleAssembler = new cDvbSubtitleAssembler; dvbSubtitleAssembler = new cDvbSubtitleAssembler;
osd = NULL; osd = NULL;
frozen = false;
pages = new cList<cDvbSubtitlePage>; pages = new cList<cDvbSubtitlePage>;
bitmaps = new cList<cDvbSubtitleBitmaps>; bitmaps = new cList<cDvbSubtitleBitmaps>;
Start(); Start();
@ -685,6 +686,7 @@ void cDvbSubtitleConverter::Reset(void)
pages->Clear(); pages->Clear();
bitmaps->Clear(); bitmaps->Clear();
DELETENULL(osd); DELETENULL(osd);
frozen = false;
Unlock(); Unlock();
} }
@ -776,46 +778,48 @@ void cDvbSubtitleConverter::Action(void)
int LastSetupLevel = setupLevel; int LastSetupLevel = setupLevel;
cTimeMs Timeout; cTimeMs Timeout;
while (Running()) { while (Running()) {
if (osd) {
int NewSetupLevel = setupLevel;
if (Timeout.TimedOut() || LastSetupLevel != NewSetupLevel) {
DELETENULL(osd);
}
LastSetupLevel = NewSetupLevel;
}
int WaitMs = 100; int WaitMs = 100;
Lock(); if (!frozen) {
if (cDvbSubtitleBitmaps *sb = bitmaps->First()) { if (osd) {
int64_t STC = cDevice::PrimaryDevice()->GetSTC(); int NewSetupLevel = setupLevel;
int64_t Delta = 0; if (Timeout.TimedOut() || LastSetupLevel != NewSetupLevel) {
if (STC >= 0) { DELETENULL(osd);
Delta = LimitTo32Bit(sb->Pts()) - LimitTo32Bit(STC); // some devices only deliver 32 bits
if (Delta > (int64_t(1) << 31))
Delta -= (int64_t(1) << 32);
else if (Delta < -((int64_t(1) << 31) - 1))
Delta += (int64_t(1) << 32);
}
else {
//TODO sync on PTS? are there actually devices that don't deliver an STC?
}
Delta /= 90; // STC and PTS are in 1/90000s
if (Delta <= MAXDELTA) {
if (Delta <= 0) {
dbgconverter("Got %d bitmaps, showing #%d\n", bitmaps->Count(), sb->Index() + 1);
if (AssertOsd()) {
sb->Draw(osd);
Timeout.Set(sb->Timeout() * 1000);
dbgconverter("PTS: %lld STC: %lld (%lld) timeout: %d\n", sb->Pts(), cDevice::PrimaryDevice()->GetSTC(), Delta, sb->Timeout());
}
bitmaps->Del(sb);
} }
else if (Delta < WaitMs) LastSetupLevel = NewSetupLevel;
WaitMs = Delta;
} }
else Lock();
bitmaps->Del(sb); if (cDvbSubtitleBitmaps *sb = bitmaps->First()) {
int64_t STC = cDevice::PrimaryDevice()->GetSTC();
int64_t Delta = 0;
if (STC >= 0) {
Delta = LimitTo32Bit(sb->Pts()) - LimitTo32Bit(STC); // some devices only deliver 32 bits
if (Delta > (int64_t(1) << 31))
Delta -= (int64_t(1) << 32);
else if (Delta < -((int64_t(1) << 31) - 1))
Delta += (int64_t(1) << 32);
}
else {
//TODO sync on PTS? are there actually devices that don't deliver an STC?
}
Delta /= 90; // STC and PTS are in 1/90000s
if (Delta <= MAXDELTA) {
if (Delta <= 0) {
dbgconverter("Got %d bitmaps, showing #%d\n", bitmaps->Count(), sb->Index() + 1);
if (AssertOsd()) {
sb->Draw(osd);
Timeout.Set(sb->Timeout() * 1000);
dbgconverter("PTS: %lld STC: %lld (%lld) timeout: %d\n", sb->Pts(), cDevice::PrimaryDevice()->GetSTC(), Delta, sb->Timeout());
}
bitmaps->Del(sb);
}
else if (Delta < WaitMs)
WaitMs = Delta;
}
else
bitmaps->Del(sb);
}
Unlock();
} }
Unlock();
cCondWait::SleepMs(WaitMs); cCondWait::SleepMs(WaitMs);
} }
} }

View File

@ -6,7 +6,7 @@
* *
* Original author: Marco Schlüßler <marco@lordzodiac.de> * Original author: Marco Schlüßler <marco@lordzodiac.de>
* *
* $Id: dvbsubtitle.h 2.1 2008/05/25 14:36:52 kls Exp $ * $Id: dvbsubtitle.h 2.2 2010/02/07 11:55:14 kls Exp $
*/ */
#ifndef __DVBSUBTITLE_H #ifndef __DVBSUBTITLE_H
@ -25,6 +25,7 @@ private:
static int setupLevel; static int setupLevel;
cDvbSubtitleAssembler *dvbSubtitleAssembler; cDvbSubtitleAssembler *dvbSubtitleAssembler;
cOsd *osd; cOsd *osd;
bool frozen;
cList<cDvbSubtitlePage> *pages; cList<cDvbSubtitlePage> *pages;
cList<cDvbSubtitleBitmaps> *bitmaps; cList<cDvbSubtitleBitmaps> *bitmaps;
tColor yuv2rgb(int Y, int Cb, int Cr); tColor yuv2rgb(int Y, int Cb, int Cr);
@ -36,6 +37,7 @@ public:
virtual ~cDvbSubtitleConverter(); virtual ~cDvbSubtitleConverter();
void Action(void); void Action(void);
void Reset(void); void Reset(void);
void Freeze(bool Status) { frozen = Status; }
int ConvertFragments(const uchar *Data, int Length); // for legacy PES recordings int ConvertFragments(const uchar *Data, int Length); // for legacy PES recordings
int Convert(const uchar *Data, int Length); int Convert(const uchar *Data, int Length);
static void SetupChanged(void); static void SetupChanged(void);