diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index 48050cfb9dca2..571fab311f475 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -501,6 +501,16 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio bool isDvhe = (m_hints.codec_tag == MKTAG('d', 'v', 'h', 'e')); bool isDvh1 = (m_hints.codec_tag == MKTAG('d', 'v', 'h', '1')); + // some files don't have dvhe or dvh1 tag set up but have Dolby Vision side data + if (!isDvhe && !isDvh1 && m_hints.hdrType == StreamHdrType::HDR_TYPE_DOLBYVISION) + { + // page 10, table 2 from https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby-vision-streams-within-the-http-live-streaming-format-v2.0-13-november-2018.pdf + if (m_hints.codec_tag == MKTAG('h', 'v', 'c', '1')) + isDvh1 = true; + else + isDvhe = true; + } + if (isDvhe || isDvh1) { bool displaySupportsDovi = CAndroidUtils::GetDisplayHDRCapabilities().SupportsDolbyVision(); diff --git a/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp b/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp index f8f7c71943081..896425f4f99f7 100644 --- a/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp +++ b/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp @@ -56,6 +56,7 @@ void CDVDStreamInfo::Clear() ptsinvalid = false; forced_aspect = false; bitsperpixel = 0; + hdrType = StreamHdrType::HDR_TYPE_NONE; colorSpace = AVCOL_SPC_UNSPECIFIED; colorRange = AVCOL_RANGE_UNSPECIFIED; colorPrimaries = AVCOL_PRI_UNSPECIFIED; @@ -106,6 +107,7 @@ bool CDVDStreamInfo::Equal(const CDVDStreamInfo& right, int compare) || bitsperpixel != right.bitsperpixel || bitdepth != right.bitdepth || vfr != right.vfr + || hdrType != right.hdrType || colorSpace != right.colorSpace || colorRange != right.colorRange || colorPrimaries != right.colorPrimaries @@ -227,6 +229,7 @@ void CDVDStreamInfo::Assign(const CDVDStreamInfo& right, bool withextradata) bitdepth = right.bitdepth; vfr = right.vfr; codecOptions = right.codecOptions; + hdrType = right.hdrType; colorSpace = right.colorSpace; colorRange = right.colorRange; colorPrimaries = right.colorPrimaries; @@ -296,6 +299,7 @@ void CDVDStreamInfo::Assign(const CDemuxStream& right, bool withextradata) orientation = stream->iOrientation; bitsperpixel = stream->iBitsPerPixel; bitdepth = stream->bitDepth; + hdrType = stream->hdr_type; colorSpace = stream->colorSpace; colorRange = stream->colorRange; colorPrimaries = stream->colorPrimaries; diff --git a/xbmc/cores/VideoPlayer/DVDStreamInfo.h b/xbmc/cores/VideoPlayer/DVDStreamInfo.h index 8a3da2722527d..693b515a96b2c 100644 --- a/xbmc/cores/VideoPlayer/DVDStreamInfo.h +++ b/xbmc/cores/VideoPlayer/DVDStreamInfo.h @@ -68,6 +68,7 @@ class CDVDStreamInfo int orientation; // orientation of the video in degrees counter clockwise int bitsperpixel; int bitdepth; + StreamHdrType hdrType; AVColorSpace colorSpace; AVColorRange colorRange; AVColorPrimaries colorPrimaries;