projects
/
go-opus.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b3d9bb
)
Set the callback buffer before it is invoked
author
Hraban Luyat <hraban@0brg.net>
Thu, 9 Jul 2015 12:27:32 +0000 (13:27 +0100)
committer
Hraban Luyat <hraban@0brg.net>
Thu, 9 Jul 2015 12:27:32 +0000 (13:27 +0100)
stream.go
patch
|
blob
|
history
diff --git
a/stream.go
b/stream.go
index 07a57435b2d99112471251da673f379d92774930..1544e4e83ef3d8bd83d31a08471f9ea14048726c 100644
(file)
--- a/
stream.go
+++ b/
stream.go
@@
-66,6
+66,7
@@
func (s *Stream) Init(read io.Reader) error {
return fmt.Errorf("Reader must be non-nil")
}
s.read = read
+ s.buf = make([]byte, maxEncodedFrameSize)
var errno C.int
oggfile := C.op_open_callbacks(
unsafe.Pointer(s),
@@
-77,7
+78,6
@@
func (s *Stream) Init(read io.Reader) error {
return opusfileerr(errno)
}
s.oggfile = oggfile
- s.buf = make([]byte, maxEncodedFrameSize)
return nil
}