Skip to content

Commit

Permalink
transcode: FindAudioDecoderEncoder add stream index param
Browse files Browse the repository at this point in the history
  • Loading branch information
nareix committed Jul 12, 2016
1 parent 46e601a commit 331bc9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions av/transcode/transcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ type tStream struct {
}

type Transcoder struct {
FindAudioDecoderEncoder func(codec av.AudioCodecData) (ok bool, err error, dec av.AudioDecoder, enc av.AudioEncoder)
FindAudioDecoderEncoder func(codec av.AudioCodecData, i int) (ok bool, err error, dec av.AudioDecoder, enc av.AudioEncoder)
streams []*tStream
}

func (self *Transcoder) Setup(streams []av.CodecData) (err error) {
self.streams = []*tStream{}

for _, stream := range streams {
for i, stream := range streams {
ts := &tStream{codec: stream}
if stream.Type().IsAudio() {
if self.FindAudioDecoderEncoder != nil {
var ok bool
var enc av.AudioEncoder
var dec av.AudioDecoder
ok, err, dec, enc = self.FindAudioDecoderEncoder(stream.(av.AudioCodecData))
ok, err, dec, enc = self.FindAudioDecoderEncoder(stream.(av.AudioCodecData), i)
if ok {
if err != nil {
return
Expand Down

0 comments on commit 331bc9f

Please sign in to comment.