Don't try to transcode a file if the requested format is the same and the client is not requesting to downsample

This commit is contained in:
Deluan
2020-04-02 22:17:52 -04:00
parent 2d7998de59
commit 2392060bc1
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -104,6 +104,13 @@ var _ = Describe("MediaStreamer", func() {
Expect(format).To(Equal("mp3"))
Expect(bitRate).To(Equal(192))
})
It("returns raw if requested format is the same as the original, but requested BitRate is 0", func() {
mf.Suffix = "mp3"
mf.BitRate = 320
format, bitRate := selectTranscodingOptions(ctx, ds, mf, "mp3", 0)
Expect(format).To(Equal("raw"))
Expect(bitRate).To(Equal(320))
})
})
Context("player has format configured", func() {