1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-12 13:44:56 +02:00
vlc/modules/mux
Lyndon Brown 740d1347f0 mux/ts: fix buggy iso639 handling
a handful of small mistakes were made in "simplifying" the iso-639
handling back in b8774b3c1a. this
corrects those mistakes, and in doing so brings this back into line
with all other use of the iso-639 lookup functions.

the mistakes:

 1. the english/native comments were added the wrong way around.

 2. the 2T fallback lookup was made unreachable.

    after searching with the 2B code, we either have a match, or the
    'unknown' record (which uses '?' characters). since every single entry
    in the table has a non-empty 2T code (ignoring the irrelevant end
    marker), and since the 'unknown' item also has a non-empty 2T code
    ("???"), the fallback path to search with 2T would never be triggered.

 3. the avoidance of storing language code on failed lookup was broken.

    the `*code` condition would always be true, since matching records
    always have a 2T code, and for no match "???" is always returned from
    the 'unknown' record. this means that for failed matches, "???" would
    be unintentionally written into the entry.

 4. the len==3 condition on iso-639-2 lookup was lost.

    the previous code conditionally only performed an iso-639-2 lookup if
    the string length is 3, just like all other cases of such lookups
    throughout the codebase. there was no specific reason for this to have
    been removed here. (this is going to get restored anyway momentarily
    when the code gets de-duplicated by a new function).

 5. an incorrect comment was given to the newly introduced function.

    the new `GetIso639_2LangCode()` helper function it introduced always
    returns len==3 strings, never len==0.
2021-06-12 13:09:35 +00:00
..
mp4 config: remove remaining "advanced" flags 2021-06-06 08:42:50 +00:00
mpeg mux/ts: fix buggy iso639 handling 2021-06-12 13:09:35 +00:00
asf.c config: remove remaining "advanced" flags 2021-06-06 08:42:50 +00:00
av1_pack.h mux: add AV1 samples packing helper 2018-10-17 20:40:00 +02:00
avi.c config: remove remaining "advanced" flags 2021-06-06 08:42:50 +00:00
dummy.c mux: remove MUX_GET_ADD_STREAM_WAIT 2020-03-03 19:31:54 +02:00
extradata.c mux: extradata: parametrize extradata type 2018-12-24 10:11:04 +01:00
extradata.h mux: extradata: parametrize extradata type 2018-12-24 10:11:04 +01:00
Makefile.am mux: ts/pes: add proper handling for payload injection 2021-01-13 17:53:48 +01:00
mpjpeg.c mpjpeg mux: do not use block_FifoCount() 2021-01-19 19:26:11 +02:00
ogg.c config: remove remaining "advanced" flags 2021-06-06 08:42:50 +00:00
wav.c mux: remove dead GET_STREAM_ADD_WAIT code 2020-03-03 19:31:54 +02:00