After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748289 - audio: "delay" virt-func mixes up samples and frames
audio: "delay" virt-func mixes up samples and frames
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.4.5
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-22 10:12 UTC by Dirk-Jan C. Binnema
Modified: 2015-04-27 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dirk-Jan C. Binnema 2015-04-22 10:12:51 UTC
Looking at GstAudioSinkClass, the 'delay' virtual function is documented as:

"Return how many samples are still in the device. This is used to drive the synchronisation."

However, discussion on #gstreamer revealed that actually, it needs the number of _frames_, not samples. 

Seems that at least gstsunosxsink.c, oss4-sink.c and gstdirectsoundsink.c follow the documentation and return the number of samples; alsa-sink returns the number of frames.
Comment 1 Sebastian Dröge (slomo) 2015-04-26 19:08:50 UTC
commit 531b9ba951129a5452e40043d729960c7ce71cb4
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Apr 26 21:08:14 2015 +0200

    audio: The delay vfunc returns the number of frames, not samples
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748289
Comment 2 Dirk-Jan C. Binnema 2015-04-27 06:08:39 UTC
Ah, thank you for handling this so quickly!

Note that there two mentions of 'sample' left that show up in the generated docs: 

http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/audio/gstaudiosink.c#n50
*     <listitem><para>Get the number of samples written but not yet played
*     by the device.</para></listitem>

http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/audio/gstaudiosink.h#n91
/* get number of samples queued in the device */
Comment 3 Sebastian Dröge (slomo) 2015-04-27 08:15:07 UTC
Thanks, I missed those :)

commit 9e480d11a2f3f7e9d7c5f63b883a68d62e6a4df3
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Mon Apr 27 10:08:17 2015 +0200

    audio: Change the remaining "samples" in the ::delay() vfunc docs to "frames"
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748289