From: Tim-Philipp Müller Date: Mon, 23 May 2011 12:50:46 +0000 (+0100) Subject: flacparse: tell baseparse the duration in samples for better accuracy X-Git-Tag: 1.19.3~509^2~7136^2~537 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a53540346a18d27b94f5254ac2582cb844e9bde0;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 0995d79..0c6c529 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -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"