openatv / enigma2

openatv-gui
GNU General Public License v2.0
200 stars 317 forks source link

Subtitles for the hard of hearing not correctly detected on Yle HD channels #792

Closed NovusOrigine closed 2 years ago

NovusOrigine commented 6 years ago

OpenATV fails to recognise the subtitle type of DVB subtitles on the HD DVB channels of the Finnish public broadcaster Yleisradio ("Yle"). The transmitted descriptors for the subtitle components are of types 0x14 (normal DVB HD subtitles; translations) and 0x24 (DVB HD subtitles for the hard of hearing; Finnish or Swedish matching audio), but OpenATV only recognises types 0x10-0x13 and 0x20-0x23. Hence, it changes the type of both subtitle streams to 0x10, normal DVB subtitles for no display type in particular. This results in a warning in the debug log similar to the following:

18:52:20.617 [   ] dvb/pmtparse.cpp:219 getProgramInfo dvb subtitle  PID 084f with wrong subtitling type (14)... force 0x10!!
18:52:20.618 [   ] dvb/pmtparse.cpp:219 getProgramInfo dvb subtitle  PID 0866 with wrong subtitling type (24)... force 0x10!!

One consequence of this is that auto language selection cannot distinguish between the normal subtitles and the subtitles for the hard of hearing. "Allow subtitles for hearing impaired" and "Prefer subtitles for hearing impaired", in particular, have no effect on Yle's HD channels; even if they are both turned off, OpenATV may select subtitles for the hard of hearing and ignore the normal subtitles when they start, if you allow it to auto-select Finnish subtitles with Finnish audio. If you don't allow Finnish subtitles with Finnish audio (e.g. through the setting "Allow subtitle language to equal audio language"), Yle's channels work as expected, but commercial channel MTV3 and its sister channels (in SD) will no longer have automatic subtitles (since they mark all audio as Finnish irrespective of the actual content, unlike Yle). This means that a Finnish user often must select the desired subtitles manually through the subtitle selection menu when viewing Live TV or recordings.

The relevant code is in enigma2/lib/dvb/pmtparse.cpp (currently, lines 220-230):

switch(s.subtitling_type)
{
case 0x10 ... 0x13: // dvb subtitles normal
case 0x20 ... 0x23: // dvb subtitles hearing impaired
    break;
default:
    eDebug("dvb subtitle %s PID %04x with wrong subtitling type (%02x)... force 0x10!!",
    s.language_code.c_str(), s.pid, s.subtitling_type);
    s.subtitling_type = 0x10;
    break;
}

Based on ETSI EN 300 468 V1.15.1, Table 26, I recommend changing the normal subtitles case to 0x10 ... 0x15 and the hearing impaired case to 0x20 ... 0x25. That should allow the subtitles to be properly recognised on Yle HD, allowing a (not atypical) Finnish user to set "Allow subtitle language to equal audio language" to "All", subtitle language(s) to Finnish and "Allow/Prefer subtitles for hearing impaired" to "Off" to make sure normal Finnish subtitles are automatically shown on all Finnish free-to-air channels.

I'm currently running OpenATV 5.3.0 (2017-02-26) (as supplied by Finnish distributor SatShop.fi) on a Vu+ Duo² receiving DVB-C from the DNA Welho network in Helsinki.

NovusOrigine commented 6 years ago

Automatic subtitle selection works as expected for me now in openatv-6.0-vuduo2-20170925, and I haven't experienced any crashes so far.

jbleyel commented 2 years ago

Issue closed .. please open a new one if the error still exists.