Skip to content

flacenc and flacdec: Fix unreported latency

Both flacenc and flacdec elements buffer data for a while and they do not report latency. This can be easily checked by running the following pipeline (no audio playing):

gst-launch-1.0 alsasrc ! flacenc ! flacparse ! flacdec ! alsasink

The latency of both codecs can be checked by looking at the buffer timestamps with the following pipeline:

gst-launch-1.0 -v alsasrc ! identity silent=false ! flacenc ! identity silent=false ! flacparse ! flacdec ! identity silent=false ! alsasink

The FLAC specification states that the data is processed in blocks, regardless of the number of channels. Thus, The latency can be calculated using the blocksize and rate. For example a 1 second block sampled at 44.1KHz has a blocksize of 44100.

The following patch report that latency in both elements and audio can be heard.

Edited by Julian Bouzas

Merge request reports

Loading