[Bug 748680] directsoundsink: fix sleep for buffer-time lower than 200000
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Wed Dec 16 00:28:52 PST 2015
https://bugzilla.gnome.org/show_bug.cgi?id=748680
Sebastian Dröge (slomo) <slomo at coaxion.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #317474|none |reviewed
status| |
--- Comment #5 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 317474:
--> (https://bugzilla.gnome.org/review?bug=748680&attachment=317474)
::: sys/directsound/gstdirectsoundsink.c
@@ +506,3 @@
+ dsoundsink->latency_time = spec->latency_time;
+
+ dsoundsink->sample_rate = spec->info.rate;
You could also just access that at any point after prepare() from the spec
field of GstAudioBaseSink's ringbuffer field.
@@ +641,3 @@
+ dsoundsink->sample_rate;
+
+ sleepTime = (dsoundsink->latency_time / 1000) - dwFreeBufferTime;
Why? Wouldn't it be better to wait for ((length - dwFreeBufferSize) * 1000) /
(bytes_per_sample * sample_rate) milliseconds instead? That would be the amount
of time that is missing from the buffer size before we can fill it with the
complete data we currently have.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list