Skip to content

Commit

Permalink
dont cache partial transcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Sep 28, 2023
1 parent 3365591 commit aa581e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transcode/transcoder_caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ func NewCachingTranscoder(t Transcoder, cachePath string) *CachingTranscoder {
}

func (t *CachingTranscoder) Transcode(ctx context.Context, profile Profile, in string, out io.Writer) error {
// don't try cache partial transcodes
if profile.Seek() > 0 {
return t.transcoder.Transcode(ctx, profile, in, out)
}

if err := os.MkdirAll(t.cachePath, perm^0o111); err != nil {
return fmt.Errorf("make cache path: %w", err)
}
Expand Down

0 comments on commit aa581e4

Please sign in to comment.