Skip to content

Commit

Permalink
Merge pull request #1 from LuaxY/master
Browse files Browse the repository at this point in the history
Add subtitle support
  • Loading branch information
vansante authored May 1, 2018
2 parents 6489095 + fd3bbf1 commit d08148e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions probedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
STREAM_ANY StreamType = ""
STREAM_VIDEO = "video"
STREAM_AUDIO = "audio"
STREAM_SUBTITLE = "subtitle"
)

type ProbeData struct {
Expand Down Expand Up @@ -146,4 +147,17 @@ func (p *ProbeData) GetFirstAudioStream() (str *Stream) {
}
}
return
}

func (p *ProbeData) GetFirstSubtitleStream() (str *Stream) {
for _, s := range p.Streams {
if s == nil {
continue
}
if s.CodecType == STREAM_SUBTITLE {
str = s
return
}
}
return
}

0 comments on commit d08148e

Please sign in to comment.