diff --git a/packager/hls/base/media_playlist.cc b/packager/hls/base/media_playlist.cc index 15b9375542..cb26655034 100644 --- a/packager/hls/base/media_playlist.cc +++ b/packager/hls/base/media_playlist.cc @@ -636,7 +636,11 @@ void MediaPlaylist::RemoveOldSegment(int64_t start_time) { while (segments_to_be_removed_.size() > hls_params_.preserved_segments_outside_live_window) { VLOG(2) << "Deleting " << segments_to_be_removed_.front(); - File::Delete(segments_to_be_removed_.front().c_str()); + if (!File::Delete(segments_to_be_removed_.front().c_str())) { + LOG(WARNING) << "Failed to delete " << segments_to_be_removed_.front() + << "; Will retry later."; + break; + } segments_to_be_removed_.pop_front(); } } diff --git a/packager/mpd/base/representation.cc b/packager/mpd/base/representation.cc index f7b90e84e4..c557f91616 100644 --- a/packager/mpd/base/representation.cc +++ b/packager/mpd/base/representation.cc @@ -500,7 +500,11 @@ void Representation::RemoveSegments(int64_t start_time, while (segments_to_be_removed_.size() > mpd_options_.mpd_params.preserved_segments_outside_live_window) { VLOG(2) << "Deleting " << segments_to_be_removed_.front(); - File::Delete(segments_to_be_removed_.front().c_str()); + if (!File::Delete(segments_to_be_removed_.front().c_str())) { + LOG(WARNING) << "Failed to delete " << segments_to_be_removed_.front() + << "; Will retry later."; + break; + } segments_to_be_removed_.pop_front(); } }