From c07dc7fdf891b113d33b9b8c6ccac7e67126a1f9 Mon Sep 17 00:00:00 2001 From: peak3d Date: Wed, 31 Jan 2018 09:14:33 +0100 Subject: [VP] Add Reset method to VideoPicture which has changed from struct to class --- .../VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp | 33 ++++++++++++++++++++++ .../VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 1 + 2 files changed, 34 insertions(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp index e12dc7c869..90277fdbea 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp @@ -42,6 +42,39 @@ VideoPicture::~VideoPicture() } } +void VideoPicture::Reset() +{ + if (videoBuffer) + videoBuffer->Release(); + videoBuffer = nullptr; + pts = DVD_NOPTS_VALUE; + dts = DVD_NOPTS_VALUE; + iFlags = 0; + iRepeatPicture = 0; + iDuration = 0; + iFrameType = 0; + color_space = AVCOL_SPC_UNSPECIFIED; + color_range = 0; + chroma_position = 0; + color_primaries = 0; + color_transfer = 0; + colorBits = 8; + stereoMode.clear(); + + qp_table = nullptr; + qstride = 0; + qscale_type = 0; + pict_type = 0; + + hasDisplayMetadata = false; + hasLightMetadata = false; + + iWidth = 0; + iHeight = 0; + iDisplayWidth = 0; + iDisplayHeight = 0; +} + VideoPicture& VideoPicture::CopyRef(const VideoPicture &pic) { if (videoBuffer) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h index e482ea9e73..20a13d8c93 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h @@ -53,6 +53,7 @@ public: ~VideoPicture(); VideoPicture& CopyRef(const VideoPicture &pic); VideoPicture& SetParams(const VideoPicture &pic); + void Reset(); // reinitialize members, videoBuffer will be released if set! CVideoBuffer *videoBuffer = nullptr; -- cgit v1.2.3