mirror of https://bitbucket.org/ausocean/av.git
Merged in revid-config-safer (pull request #112)
Made revid's Config() func safer Approved-by: kortschak <dan@kortschak.io>
This commit is contained in:
commit
137943af82
|
@ -171,16 +171,6 @@ func (r *Revid) Bitrate() int {
|
|||
return r.bitrate
|
||||
}
|
||||
|
||||
// Config returns the Revid's config.
|
||||
func (r *Revid) Config() *Config {
|
||||
// FIXME(kortschak): This is a massive footgun and should not exist.
|
||||
// Since the config's fields are accessed in running goroutines, any
|
||||
// mutation is a data race. With bad luck a data race is possible by
|
||||
// reading the returned value since it is possible for the running
|
||||
// Ravid to mutate the config it holds.
|
||||
return &r.config
|
||||
}
|
||||
|
||||
// reset swaps the current config of a Revid with the passed
|
||||
// configuration; checking validity and returning errors if not valid.
|
||||
func (r *Revid) reset(config Config) error {
|
||||
|
|
Loading…
Reference in New Issue