aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Karlman <jonas@kwiboo.se>2019-04-22 20:03:55 +0000
committerJonas Karlman <jonas@kwiboo.se>2019-06-13 22:16:10 +0000
commitb89d0a4a03b4e18b93619b41b3f76d3ef1cf6ac3 (patch)
tree3a827277c57bc45a17562c8007271867c8d31481
parentc3d2dff4afdba813b960aba8f95fbbf47d5a2da5 (diff)
DVDVideoCodecDRMPRIME: GetPicture only works for DRM_PRIME pix fmt
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 30faecaa91..8db92f15ff 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -151,13 +151,6 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
return false;
}
- if (m_pCodecContext->pix_fmt != AV_PIX_FMT_DRM_PRIME)
- {
- CLog::Log(LOGNOTICE, "CDVDVideoCodecDRMPRIME::%s - unexpected pix fmt %s", __FUNCTION__, av_get_pix_fmt_name(m_pCodecContext->pix_fmt));
- avcodec_free_context(&m_pCodecContext);
- return false;
- }
-
const char* pixFmtName = av_get_pix_fmt_name(m_pCodecContext->pix_fmt);
m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
m_processInfo.SetVideoDimensions(hints.width, hints.height);
@@ -282,9 +275,18 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
SetPictureParams(pVideoPicture);
- CVideoBufferDRMPRIME* buffer = dynamic_cast<CVideoBufferDRMPRIME*>(m_videoBufferPool->Get());
- buffer->SetRef(m_pFrame);
- pVideoPicture->videoBuffer = buffer;
+ if (m_pFrame->format == AV_PIX_FMT_DRM_PRIME)
+ {
+ CVideoBufferDRMPRIME* buffer = dynamic_cast<CVideoBufferDRMPRIME*>(m_videoBufferPool->Get());
+ buffer->SetRef(m_pFrame);
+ pVideoPicture->videoBuffer = buffer;
+ }
+
+ if (!pVideoPicture->videoBuffer)
+ {
+ CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::{} - videoBuffer:nullptr format:{}", __FUNCTION__, av_get_pix_fmt_name(static_cast<AVPixelFormat>(m_pFrame->format)));
+ return VC_ERROR;
+ }
return VC_PICTURE;
}