Fixed an error in displayreplay if no recording information are available

This commit is contained in:
kamel5 2021-02-01 13:31:08 +01:00
parent 6aeaf41467
commit 1c393e23a5
3 changed files with 33 additions and 4 deletions

View File

@ -191,6 +191,8 @@ void cViewReplay::GetTimers(void) {
void cViewReplay::SetTimeShiftValues(const cRecording *recording) {
//check for instant recording
if (!recording)
return;
const char *recName = recording->Name();
if (recName && *recName == '@')
return;
@ -224,6 +226,12 @@ void cViewReplay::SetTitle(const char *title) {
if (veRecTitle) {
veRecTitle->Set(title);
}
if (veRecInfo) {
veRecInfo->Set(NULL);
}
if (veScraperContent) {
veScraperContent->Set(NULL);
}
}
void cViewReplay::SetCurrent(const char *current) {
@ -239,7 +247,7 @@ void cViewReplay::SetTotal(const char *total) {
}
void cViewReplay::SetEndTime(int current, int total) {
if (!veEndTime)
if (!veEndTime || reclength == 0)
return;
int totalLength = total;
int recordingLength = reclength;

View File

@ -25,10 +25,24 @@ void cVeDrRecTitle::SetTokenContainer(void) {
}
void cVeDrRecTitle::Set(const cRecording *recording) {
if (this->title) {
free(this->title);
this->title = NULL;
}
if (this->recording)
this->recording = NULL;
if (!recording)
return;
this->recording = recording;
}
void cVeDrRecTitle::Set(const char *title) {
if (this->title) {
free(this->title);
this->title = NULL;
}
if (this->recording)
this->recording = NULL;
if (!title)
return;
free(this->title);

View File

@ -25,7 +25,14 @@ void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
}
void cSDDisplayReplay::SetTitle(const char *Title) {
if (!ok)
return;
view->SetTitle(Title);
if (init) {
view->SetRecordingLength(0);
view->SetTimeShiftValues(NULL);
init = false;
}
}
void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {