diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-03-05 17:54:43 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-03-06 11:27:41 -0300 |
commit | c194f2de1206ebd41b3d7b8b2f4902c48dc5ebb8 (patch) | |
tree | 39cc5570d82ed7bd9f2759b5161fcdaa7ebfd793 /sys | |
parent | b0ce43cde38e1a89f56c8e0a946a1fedc783656a (diff) |
directsoundsink: fix modulo math with ringbuffer parameters
To get a multiple of bpf use a subtraction and not an addition
https://bugzilla.gnome.org/show_bug.cgi?id=745684
Diffstat (limited to 'sys')
-rw-r--r-- | sys/directsound/gstdirectsoundsink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/directsound/gstdirectsoundsink.c b/sys/directsound/gstdirectsoundsink.c index 56b04187c..bee96d16a 100644 --- a/sys/directsound/gstdirectsoundsink.c +++ b/sys/directsound/gstdirectsoundsink.c @@ -444,12 +444,12 @@ gst_directsound_sink_prepare (GstAudioSink * asink, gst_util_uint64_scale_int (wfx.nAvgBytesPerSec, spec->buffer_time, GST_MSECOND); /* Make sure we make those numbers multiple of our sample size in bytes */ - dsoundsink->buffer_size += dsoundsink->buffer_size % spec->info.bpf; + dsoundsink->buffer_size -= dsoundsink->buffer_size % spec->info.bpf; spec->segsize = gst_util_uint64_scale_int (wfx.nAvgBytesPerSec, spec->latency_time, GST_MSECOND); - spec->segsize += spec->segsize % spec->info.bpf; + spec->segsize -= spec->segsize % spec->info.bpf; spec->segtotal = dsoundsink->buffer_size / spec->segsize; } else { #ifdef WAVE_FORMAT_DOLBY_AC3_SPDIF |