detect isRadio proper in case recording is missing "X 1" (happen on e.g. RTL channel)

This commit is contained in:
Peter Bieringer 2021-01-23 10:32:08 +01:00
parent 59248ccebb
commit 2eef09e6aa
5 changed files with 12 additions and 9 deletions

View File

@ -1884,8 +1884,7 @@ bool cLeMenuRecordings::Parse(bool forced) {
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond()); tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info' tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info' tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
SetScraperRecordingPoster(tokenContainer, usedRecording, true); SetScraperRecordingPoster(tokenContainer, usedRecording, true);
return true; return true;
@ -2146,7 +2145,7 @@ bool cCeMenuRecordings::Parse(bool forced) {
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond()); tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info' tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info' tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
SetScraperRecordingPoster(tokenContainer, usedRecording, false); SetScraperRecordingPoster(tokenContainer, usedRecording, false);

View File

@ -698,7 +698,7 @@ bool cViewDetailRec::Parse(bool forced) {
tokenContainer->AddStringToken((int)eDmDetailedRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60)); tokenContainer->AddStringToken((int)eDmDetailedRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info' tokenContainer->AddIntToken((int)eDmDetailedRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info' tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
} }
} }
SetRecInfos(); SetRecInfos();

View File

@ -657,11 +657,12 @@ bool RecordingIsUHD(const cEvent* event) {
return isUHD; return isUHD;
}; };
bool RecordingIsRadio(const cEvent* event) { bool RecordingIsRadio(const cEvent* event, const double FramesPerSecond) {
// detect Radio from 'info' // detect Radio from 'info'
bool isRadio = false; bool isRadio = false;
bool hasAudio = false; bool hasAudio = false;
bool hasVideo = false; bool hasVideo = false;
cComponents *Components = (cComponents *)event->Components(); cComponents *Components = (cComponents *)event->Components();
if (Components) { if (Components) {
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio // Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio
@ -704,8 +705,11 @@ bool RecordingIsRadio(const cEvent* event) {
}; };
}; };
if ((hasAudio == true) && (hasVideo == false)) if ((hasAudio == true) && (hasVideo == false)) {
isRadio = true; if (FramesPerSecond < 24) { // workaround for issue of missing "X 1" on some SD channels (e.g. RTL)
isRadio = true;
};
};
return isRadio; return isRadio;
}; };

View File

@ -115,6 +115,6 @@ public:
******************************************************************/ ******************************************************************/
bool RecordingIsHD(const cEvent* event); bool RecordingIsHD(const cEvent* event);
bool RecordingIsUHD(const cEvent* event); bool RecordingIsUHD(const cEvent* event);
bool RecordingIsRadio(const cEvent* event); bool RecordingIsRadio(const cEvent* event, const double FramesPerSecond);
#endif //__VIEWELEMENT_H #endif //__VIEWELEMENT_H

View File

@ -1217,7 +1217,7 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60)); tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info' tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info' tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
} }
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) #if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;