Skip to content

Commit

Permalink
hotfix: fixed the getstreamduration
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxx committed May 30, 2023
1 parent be4e970 commit a414de7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ffprobe/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ func (p *Probe) GetResolution() (width int, height int) {
}

func (p *Probe) GetStreamDuration(codecType ...string) (float64, error) {
selected := 'video'
if len(codecTypes) > 0{
selected = codecType[0]
selectedCodec := "video"
if len(codecType) > 0 {
selectedCodec = codecType[0]
}
var selected Stream
for _, stream := range p.Streams {
if stream.CodecType == codecType {
if stream.CodecType == selectedCodec {
selected = stream
break
}
Expand Down

0 comments on commit a414de7

Please sign in to comment.