audio: Add comments

This commit is contained in:
Hajime Hoshi 2019-04-01 01:59:10 +09:00
parent df2604c221
commit acc4ef4e11

View File

@ -266,6 +266,8 @@ type proceededValues struct {
// //
// NewPlayer tries to call Seek of src to get the current position. // NewPlayer tries to call Seek of src to get the current position.
// NewPlayer returns error when the Seek returns error. // NewPlayer returns error when the Seek returns error.
//
// NewPlayer takes the ownership of src. Player's Close calls src's Close.
func NewPlayer(context *Context, src io.ReadCloser) (*Player, error) { func NewPlayer(context *Context, src io.ReadCloser) (*Player, error) {
if context.mux.hasSource(src) { if context.mux.hasSource(src) {
return nil, errors.New("audio: src cannot be shared with another Player") return nil, errors.New("audio: src cannot be shared with another Player")