[Solved] Change OSD Timeout for skip in video playback

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
boomshalek
Newcomer
Posts: 12
Joined: Wed Jul 02, 2014 10:55 am
Germany

[Solved] Change OSD Timeout for skip in video playback

Post by boomshalek »

Hello
I have done some searching how to change the default value for the OSD being shown while skipping during video playback (watch recordings or movies from my converted dvd collection).

The only information I have found are several different but quite old discussions and even rejected commits about this in the past ( also see mythtv-dev mailing list from 2010) and apparently if i am informed correctly no user setup settings for this.

I do understand that developers agreed that there are five different generalized cases a OSD is shown (see code below) and for each of those generalized cases OSD is shown at a different length. The value for Medium is the one I am interested in to change to 1.5 seconds. I want OSD to show up shorter than the default 5 secs when skipping back and forth during video playback.

So I was browsing the source code and found osd.h which defines these values as "enumerators" which I don't understand. In the past it was defined in miliseconds, but this has changed.

Code: Select all

enum OSDTimeout
 {
     kOSDTimeout_Ignore = -1, // Don't update existing timeout
     kOSDTimeout_None   = 0,  // Don't timeout
     kOSDTimeout_Short  = 1,
     kOSDTimeout_Med    = 2,
     kOSDTimeout_Long   = 3,
 };
Can someone direct me to the solution that i can change the OSD behaviour ?
I could create a patch myself if someone pointed me towards how to change kOSDTimeout_Short.

Thank you all very much in advance.

As a later step I would be really glad if this could be integrated into
(Setup->Video->Playback OSD) or
(Setup->Video->Playback Groups)

But after reading the developers discussion in mythtv-dev I have lost hope for this.
Last edited by boomshalek on Fri Oct 15, 2021 3:54 pm, edited 2 times in total.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Change OSD Timeout for skip in video playback

Post by paulh »

Looks like the timeouts are hard coded to 3s, 5s and 13s here :-

https://github.com/MythTV/mythtv/blob/m ... osd.h#L151
boomshalek
Newcomer
Posts: 12
Joined: Wed Jul 02, 2014 10:55 am
Germany

Re: Change OSD Timeout for skip in video playback

Post by boomshalek »

paulh wrote:
Thu Oct 14, 2021 5:03 pm
Looks like the timeouts are hard coded to 3s, 5s and 13s here :-
https://github.com/MythTV/mythtv/blob/m ... osd.h#L151
Hi
Thank you for your fast reaction!
Do you mean line 151 ?

Code: Select all

std::array<std::chrono::milliseconds,4> m_timeouts  { -1ms, 3s, 5s, 13s };
In that case it could be easily patched. I will try this ASAP.

I just do not understand why are there only 4 values in the array, but in the enumerator function there are 5 cases. The 0 is missing ...
Anyway I will report back
boomshalek
Newcomer
Posts: 12
Joined: Wed Jul 02, 2014 10:55 am
Germany

Re: Change OSD Timeout for skip in video playback

Post by boomshalek »

'ello again
Thank you again for the hint. The sources in the previous posts were linked to the master tree (0.32pre-ish).
As I am using mythtv 31 version it was slightly different, but still easy to patch.

Code: Select all

--- mythtv/libs/libmythtv/osd.h 2021-08-08 14:39:56.000000000 +0200
+++ mythtv-patched/libs/libmythtv/osd.h 2021-10-15 15:43:45.868715109 +0200
@@ -208,7 +208,7 @@
     QDateTime       m_nextPulseUpdate   { };
     bool            m_refresh           { false };
     bool            m_visible           { false };
-    int             m_timeouts[4]       { -1,3000,5000,13000 };
+    int             m_timeouts[4]       { -1,2000,2000,13000 };
     bool            m_uiScaleOverride   { false };
     float           m_savedWMult        { 1.0F };
     float           m_savedHMult        { 1.0F };
worked a treat. Thank you very much :idea:
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: [Solved] Change OSD Timeout for skip in video playback

Post by paulh »

Yeah that is the line. The github link should have highlighted line 151 it does here using Firefox :?

I'd forgot about the discussion about this, can't believe that ticket is 11 years old :roll:

Personally I don't see a problem with having reasonable defaults that work for most people but also have settings the user can change to alter the timeouts to whatever the user chooses. Stuart M is no longer with the project so a patch to do that might be looked at in a more favourable light ;)

Agreed the way the timeout is looked up is a little odd the value from enum is used as an index into that array of timeouts so kOSDTimeout_None (0) becomes -1ms and kOSDTimeout_Short (1) becomes 3s and so one. I would think if kOSDTimeout_Ignore (-1) is used to lookup the timeout then something bad will happen!
Post Reply