Skip to content

Commit

Permalink
Merge pull request #31 from r3b-fish/feature/audio-bitrate-must-be-st…
Browse files Browse the repository at this point in the history
…ring

Method SetAudioBitrate must receive a string value
  • Loading branch information
xfrr authored Sep 4, 2019
2 parents df9067d + c17e9a2 commit 98b69d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions models/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Mediafile struct {
minKeyframe int
keyframeInterval int
audioCodec string
audioBitrate int
audioBitrate string
audioChannels int
bufferSize int
threads int
Expand Down Expand Up @@ -130,7 +130,7 @@ func (m *Mediafile) SetAudioCodec(v string) {
m.audioCodec = v
}

func (m *Mediafile) SetAudioBitRate(v int) {
func (m *Mediafile) SetAudioBitRate(v string) {
m.audioBitrate = v
}

Expand Down Expand Up @@ -333,7 +333,7 @@ func (m *Mediafile) AudioCodec() string {
return m.audioCodec
}

func (m *Mediafile) AudioBitrate() int {
func (m *Mediafile) AudioBitrate() string {
return m.audioBitrate
}

Expand Down Expand Up @@ -640,8 +640,8 @@ func (m *Mediafile) ObtainAudioCodec() []string {
}

func (m *Mediafile) ObtainAudioBitRate() []string {
if m.audioBitrate != 0 {
return []string{"-b:a", fmt.Sprintf("%d", m.audioBitrate)}
if m.audioBitrate != "" {
return []string{"-b:a", m.audioBitrate}
}
return nil
}
Expand Down

0 comments on commit 98b69d9

Please sign in to comment.