@ -72,9 +72,9 @@ func (s *S3Storage) SegmentWritten(localFilePath string) {
@@ -72,9 +72,9 @@ func (s *S3Storage) SegmentWritten(localFilePath string) {
utils . StartPerformanceMonitor ( performanceMonitorKey )
// Upload the segment
_ , erro r := s . Save ( localFilePath , 0 )
if erro r != nil {
log . Errorln ( erro r)
_ , er r := s . Save ( localFilePath , 0 )
if er r != nil {
log . Errorln ( er r)
return
}
averagePerformance := utils . GetAveragePerformance ( performanceMonitorKey )
@ -89,11 +89,11 @@ func (s *S3Storage) SegmentWritten(localFilePath string) {
@@ -89,11 +89,11 @@ func (s *S3Storage) SegmentWritten(localFilePath string) {
// Upload the variant playlist for this segment
// so the segments and the HLS playlist referencing
// them are in sync.
playlist := filepath . Join ( filepath . Dir ( localFilePath ) , "stream.m3u8" )
_ , erro r = s . Save ( playlist , 0 )
if erro r != nil {
_queuedPlaylistUpdates [ playlist ] = playlist
if pErr , ok := erro r. ( * os . PathError ) ; ok {
playlistPath := filepath . Join ( filepath . Dir ( localFilePath ) , "stream.m3u8" )
_ , er r = s . Save ( playlistPath , 0 )
if er r != nil {
_queuedPlaylistUpdates [ playlistPath ] = playlistPath
if pErr , ok := er r. ( * os . PathError ) ; ok {
log . Debugln ( pErr . Path , "does not yet exist locally when trying to upload to S3 storage." )
return
}
@ -106,9 +106,9 @@ func (s *S3Storage) VariantPlaylistWritten(localFilePath string) {
@@ -106,9 +106,9 @@ func (s *S3Storage) VariantPlaylistWritten(localFilePath string) {
// to make sure we're not refering to files in a playlist that don't
// yet exist. See SegmentWritten.
if _ , ok := _queuedPlaylistUpdates [ localFilePath ] ; ok {
_ , erro r := s . Save ( localFilePath , 0 )
if erro r != nil {
log . Errorln ( erro r)
_ , er r := s . Save ( localFilePath , 0 )
if er r != nil {
log . Errorln ( er r)
_queuedPlaylistUpdates [ localFilePath ] = localFilePath
}
delete ( _queuedPlaylistUpdates , localFilePath )