• Niklas Haas's avatar
    avcodec/h2645_sei: loosen up min luminance requirements · 9fd88bd0
    Niklas Haas authored
    The H.265 specification is quite clear on this case:
    
    > When min_display_mastering_luminance is not in the range of 1 to
    > 50000, the nominal maximum display luminance of the mastering display
    > is unknown or unspecified or specified by other means not specified in
    > this Specification.
    
    And so the current code is correct in marking luminance data as invalid
    if min luminance is set to 0. However, this breaks playback of at least
    several real-world Blu-ray releases, for example La La Land, Planet of
    the Apes, and quite possibly a lot more. These come with ostensibly
    valid max_luminance tags (1000 nits), but min_luminance set to 0.
    
    Loosen up this requirement by guarding it behind FF_COMPLIANCE_STRICT.
    We still reject blatantly invalid metadata (wrong value range on
    luminance, max set to 0, max below min, min above 50 nits etc.), so this
    shouldn't cause any unintended regressions.
    
    Fixes: https://github.com/mpv-player/mpv/issues/14177
    9fd88bd0
h2645_sei.c 32.5 KB