Skip to content

Commit

Permalink
refactor: move vorbis metadata page to proper package
Browse files Browse the repository at this point in the history
  • Loading branch information
devgianlu committed Nov 12, 2024
1 parent 85b1bb1 commit 1d99d0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (p *Player) NewStream(spotId librespot.SpotifyId, bitrate int, mediaPositio
return nil, fmt.Errorf("failed intializing audio decryptor: %w", err)
}

audioStream, meta, err := audio.ExtractMetadataPage(decryptedStream, rawStream.Size())
audioStream, meta, err := vorbis.ExtractMetadataPage(decryptedStream, rawStream.Size())
if err != nil {
return nil, fmt.Errorf("failed reading metadata page: %w", err)
}
Expand Down
5 changes: 2 additions & 3 deletions vorbis/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"sync"

librespot "github.com/devgianlu/go-librespot"
"github.com/devgianlu/go-librespot/audio"
log "github.com/sirupsen/logrus"

"github.com/xlab/vorbis-go/vorbis"
Expand All @@ -29,7 +28,7 @@ type Decoder struct {
Channels int32

// meta is the associated metadata (for seeking)
meta *audio.MetadataPage
meta *MetadataPage

// gain is the default track gain.
gain float32
Expand Down Expand Up @@ -85,7 +84,7 @@ type Info struct {
}

// New creates and initialises a new OggVorbis decoder for the provided bytestream.
func New(log *log.Entry, r librespot.SizedReadAtSeeker, meta *audio.MetadataPage, gain float32) (*Decoder, error) {
func New(log *log.Entry, r librespot.SizedReadAtSeeker, meta *MetadataPage, gain float32) (*Decoder, error) {
d := &Decoder{
log: log,
input: r,
Expand Down
2 changes: 1 addition & 1 deletion audio/metadata.go → vorbis/metadata.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package audio
package vorbis

import (
"bytes"
Expand Down

0 comments on commit 1d99d0c

Please sign in to comment.