mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
flacdec: Correct sample number rounding resulting in timestamp jitter
flacdec converts the src timestamp to a sample number, uses that internally, then reconverts the sample number to a timestamp for the output buffer. Unfortunately, sample numbers can't be represented in an integer number of nanoseconds, and the conversion process was truncating rather than rounding, resulting in sample numbers and output timestamps that were often off by a full sample. This corrects the time->sample convesion
This commit is contained in:
parent
88557c4792
commit
799c8e3d04
1 changed files with 1 additions and 1 deletions
|
@ -1668,7 +1668,7 @@ gst_flac_dec_convert_src (GstPad * pad, GstFormat src_format, gint64 src_value,
|
|||
case GST_FORMAT_BYTES:
|
||||
scale = bytes_per_sample;
|
||||
case GST_FORMAT_DEFAULT:
|
||||
*dest_value = gst_util_uint64_scale_int (src_value,
|
||||
*dest_value = gst_util_uint64_scale_int_round (src_value,
|
||||
scale * flacdec->sample_rate, GST_SECOND);
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue