mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
flacparse: tell baseparse the duration in samples for better accuracy
Tell GstBaseParse the duration in samples instead of time, so that a duration query in DEFAULT format will return the correct number of samples without rounding errors. Baseparse will convert this into time itself when needed. https://bugzilla.gnome.org/show_bug.cgi?id=650785
This commit is contained in:
parent
900b2fb63d
commit
a53540346a
1 changed files with 4 additions and 4 deletions
|
@ -798,10 +798,10 @@ gst_flac_parse_handle_streaminfo (GstFlacParse * flacparse, GstBuffer * buffer)
|
|||
|
||||
if (!gst_bit_reader_get_bits_uint64 (&reader, &flacparse->total_samples, 36))
|
||||
goto error;
|
||||
if (flacparse->total_samples)
|
||||
gst_base_parse_set_duration (GST_BASE_PARSE (flacparse), GST_FORMAT_TIME,
|
||||
GST_FRAMES_TO_CLOCK_TIME (flacparse->total_samples,
|
||||
flacparse->samplerate), 0);
|
||||
if (flacparse->total_samples) {
|
||||
gst_base_parse_set_duration (GST_BASE_PARSE (flacparse),
|
||||
GST_FORMAT_DEFAULT, flacparse->total_samples, 0);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (flacparse, "STREAMINFO:\n"
|
||||
"\tmin/max blocksize: %u/%u,\n"
|
||||
|
|
Loading…
Reference in a new issue