flacparse: tweak setting buffer metadata; avoid timestamp jitter

Fixes #631993.
This commit is contained in:
Mark Nauwelaerts 2010-10-13 11:00:01 +02:00
parent 7499f2b09b
commit 697419b755

View file

@ -1247,10 +1247,11 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBuffer * buffer)
GST_BUFFER_OFFSET_END (buffer) =
flacparse->sample_number + flacparse->block_size;
}
GST_BUFFER_DURATION (buffer) =
GST_FRAMES_TO_CLOCK_TIME (flacparse->block_size, flacparse->samplerate);
GST_BUFFER_OFFSET (buffer) =
GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_DURATION (buffer);
gst_util_uint64_scale (GST_BUFFER_OFFSET_END (buffer), GST_SECOND,
flacparse->samplerate);
GST_BUFFER_DURATION (buffer) =
GST_BUFFER_OFFSET (buffer) - GST_BUFFER_TIMESTAMP (buffer);
/* Minimal size of a frame header */
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), MAX (9,