From 090cd7dabd2f975e493a9bbd22754ee578d6a1b2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Dec 2020 11:32:11 +0100 Subject: [PATCH] Add VideoRingBuffers::reset_metadata(). --- src/lib/video_ring_buffers.cc | 13 ++++++++++++- src/lib/video_ring_buffers.h | 7 ++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/video_ring_buffers.cc b/src/lib/video_ring_buffers.cc index e0e1b052c..24d904e7e 100644 --- a/src/lib/video_ring_buffers.cc +++ b/src/lib/video_ring_buffers.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016-2017 Carl Hetherington + Copyright (C) 2016-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -84,3 +84,14 @@ VideoRingBuffers::memory_used () const } return make_pair(m, String::compose("%1 frames", _data.size())); } + + +void +VideoRingBuffers::reset_metadata (shared_ptr film, dcp::Size player_video_container_size) +{ + boost::mutex::scoped_lock lm (_mutex); + for (list, DCPTime> >::const_iterator i = _data.begin(); i != _data.end(); ++i) { + i->first->reset_metadata (film, player_video_container_size); + } +} + diff --git a/src/lib/video_ring_buffers.h b/src/lib/video_ring_buffers.h index ba1b2162f..c7f789cb5 100644 --- a/src/lib/video_ring_buffers.h +++ b/src/lib/video_ring_buffers.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016-2017 Carl Hetherington + Copyright (C) 2016-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -26,8 +26,11 @@ #include #include + +class Film; class PlayerVideo; + class VideoRingBuffers : public boost::noncopyable { public: @@ -38,6 +41,8 @@ public: Frame size () const; bool empty () const; + void reset_metadata (boost::shared_ptr film, dcp::Size player_video_container_size); + std::pair memory_used () const; private: -- 2.30.2