option to disable downsampling

This commit is contained in:
Deluan
2016-03-09 22:21:11 -05:00
parent 031738f1eb
commit de6bd1eb17
2 changed files with 10 additions and 6 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ import (
func Stream(path string, bitRate int, maxBitRate int, w io.Writer) error {
var f io.Reader
var err error
if maxBitRate > 0 && bitRate > maxBitRate {
ds, _ := beego.AppConfig.Bool("enableDownsampling")
if ds && maxBitRate > 0 && bitRate > maxBitRate {
f, err = downsample(path, maxBitRate)
} else {
f, err = os.Open(path)