There was an error while loading. Please reload this page.
1 parent a7d3a22 commit d081fdeCopy full SHA for d081fde
1 file changed
media.go
@@ -217,9 +217,8 @@ func (s *WriteCloserSwitch[T]) Get() WriteCloser[T] {
217
218
// Swap sets an underlying writer and returns the old one.
219
// Caller is responsible for closing the old writer.
220
-// If switch sample rate is unset, this locks the sample rate.
221
-// If sample rate is already locked, and the new writer does not
222
-// match it the code panics.
+// When switch sample rate is unset, it is set to the new writer's sample rate.
+// If sample rate is already set, this method panics on sample rate mismatch.
223
func (s *WriteCloserSwitch[T]) Swap(w WriteCloser[T]) WriteCloser[T] {
224
var old *WriteCloser[T]
225
if w != nil {
0 commit comments