diff --git a/packager/hls/base/simple_hls_notifier.cc b/packager/hls/base/simple_hls_notifier.cc index e500e5e345..2ffa5ddb59 100644 --- a/packager/hls/base/simple_hls_notifier.cc +++ b/packager/hls/base/simple_hls_notifier.cc @@ -43,7 +43,8 @@ SimpleHlsNotifier::SimpleHlsNotifier(const std::string& prefix, prefix_(prefix), output_dir_(output_dir), media_playlist_factory_(new MediaPlaylistFactory()), - master_playlist_(new MasterPlaylist(master_playlist_name)) {} + master_playlist_(new MasterPlaylist(master_playlist_name)), + media_playlist_map_deleter_(&media_playlist_map_) {} SimpleHlsNotifier::~SimpleHlsNotifier() {} @@ -74,7 +75,8 @@ bool SimpleHlsNotifier::NotifyNewStream(const MediaInfo& media_info, base::AutoLock auto_lock(lock_); master_playlist_->AddMediaPlaylist(media_playlist.get()); - media_playlist_map_.insert(std::make_pair(*stream_id, media_playlist.Pass())); + media_playlist_map_.insert( + std::make_pair(*stream_id, media_playlist.release())); return true; } diff --git a/packager/hls/base/simple_hls_notifier.h b/packager/hls/base/simple_hls_notifier.h index 44f8c345c9..ed8a1a0d07 100644 --- a/packager/hls/base/simple_hls_notifier.h +++ b/packager/hls/base/simple_hls_notifier.h @@ -10,6 +10,7 @@ #include "packager/base/atomic_sequence_num.h" #include "packager/base/macros.h" #include "packager/base/memory/scoped_ptr.h" +#include "packager/base/stl_util.h" #include "packager/base/synchronization/lock.h" #include "packager/hls/base/hls_notifier.h" #include "packager/hls/base/master_playlist.h" @@ -72,7 +73,8 @@ class SimpleHlsNotifier : public HlsNotifier { scoped_ptr media_playlist_factory_; scoped_ptr master_playlist_; - std::map> media_playlist_map_; + std::map media_playlist_map_; + STLValueDeleter media_playlist_map_deleter_; base::AtomicSequenceNumber sequence_number_; diff --git a/packager/hls/base/simple_hls_notifier_unittest.cc b/packager/hls/base/simple_hls_notifier_unittest.cc index ad6d28fe55..3de47ab469 100644 --- a/packager/hls/base/simple_hls_notifier_unittest.cc +++ b/packager/hls/base/simple_hls_notifier_unittest.cc @@ -65,7 +65,7 @@ class SimpleHlsNotifierTest : public ::testing::Test { notifier_.master_playlist_ = playlist.Pass(); } - const std::map>& GetMediaPlaylistMap() { + const std::map& GetMediaPlaylistMap() { return notifier_.media_playlist_map_; }