delete guess expected size feature

it it doing some really bad guesses for opus files
This commit is contained in:
sentriz
2022-04-20 23:33:10 +01:00
parent 4658d07273
commit 6bebceccd9
20 changed files with 44 additions and 526 deletions

View File

@@ -2,6 +2,7 @@ package transcode
import (
"context"
"fmt"
"io"
"os"
)
@@ -14,6 +15,14 @@ func NewNoneTranscoder() *NoneTranscoder {
return &NoneTranscoder{}
}
func (*NoneTranscoder) Transcode(ctx context.Context, _ Profile, in string) (io.ReadCloser, error) {
return os.Open(in)
func (*NoneTranscoder) Transcode(ctx context.Context, _ Profile, in string, out io.Writer) error {
file, err := os.Open(in)
if err != nil {
return fmt.Errorf("open file: %w", err)
}
defer file.Close()
if _, err := io.Copy(out, file); err != nil {
return fmt.Errorf("copy file: %w", err)
}
return nil
}