Skip to content

Commit

Permalink
closing file properly
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodz committed Jan 27, 2023
1 parent a261d53 commit 77658c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/transcoder/mulaw2wav.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func mulaw2WavLpcm(in *AudioFileIn, out *AudioFileOut, transcoder *Transcoder) (

// Update the file size and data size fields
fileFixer := out.Data.(*os.File)
defer fileFixer.Close()
r, err := fileFixer.Seek(4, io.SeekStart)
if err != nil {
return fmt.Errorf("error seeking file: %v", err)
Expand Down
1 change: 1 addition & 0 deletions pkg/transcoder/mulaw2wavlogpcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func mulaw2WavLogpcm(in *AudioFileIn, out *AudioFileOut, transcoder *Transcoder)

// Update the file size and data size fields
fileFixer := out.Data.(*os.File)
defer fileFixer.Close()
r, err := fileFixer.Seek(4, io.SeekStart)
if err != nil {
return fmt.Errorf("error seeking file: %v", err)
Expand Down
1 change: 1 addition & 0 deletions pkg/transcoder/wavlpcm2wavlpcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func wavLpcm2wavLpcm(in *AudioFileIn, out *AudioFileOut, transcoder *Transcoder)

// Update the file size and data size fields
fileFixer := out.Data.(*os.File)
defer fileFixer.Close()
r, err := fileFixer.Seek(4, io.SeekStart)
if err != nil {
return fmt.Errorf("error seeking file: %v", err)
Expand Down

0 comments on commit 77658c3

Please sign in to comment.