From ae891450151d9c9a71f484640510737abb23b3b0 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 14 Jun 2021 12:10:20 -0700 Subject: [PATCH] Fix vector+unique_ptr issues with MSVS 2019 Because a StreamState object contains a unique_ptr, it is not copyable. A vector of StreamStates, therefore, causes a compile error on resize or push_back, both of which invoke the copy constructor. I don't know why MSVS complains, but clang does not. To fix this, I'm changing vector into deque. At this point static_library builds are working in MSVS 2019. shared_library builds are still not working. Issue #867 (MSVS 2019) Issue #336 (progress toward replacing Travis & Appveyor with GitHub Actions, which uses MSVS 2019) b/190743862 (internal; tracking replacement of Travis) Change-Id: Iaa9d5fc357102d15eac96c29ebeee7c7236e976b --- packager/media/chunking/cue_alignment_handler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packager/media/chunking/cue_alignment_handler.h b/packager/media/chunking/cue_alignment_handler.h index 9ae340aff0..78d8db96b4 100644 --- a/packager/media/chunking/cue_alignment_handler.h +++ b/packager/media/chunking/cue_alignment_handler.h @@ -7,6 +7,7 @@ #ifndef PACKAGER_MEDIA_CHUNKING_CUE_ALIGNMENT_HANDLER_ #define PACKAGER_MEDIA_CHUNKING_CUE_ALIGNMENT_HANDLER_ +#include #include #include "packager/media/base/media_handler.h" @@ -73,7 +74,7 @@ class CueAlignmentHandler : public MediaHandler { Status RunThroughSamples(StreamState* stream); SyncPointQueue* const sync_points_ = nullptr; - std::vector stream_states_; + std::deque stream_states_; // A common hint used by all streams. When a new cue is given to all streams, // the hint will be updated. The hint will always be larger than any cue. The