From 0d53b6ad627ff71d35ab6ff3acb1fd428bbf9d06 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 17 Dec 2009 12:45:36 +0100 Subject: [PATCH] flacparse: set _OFFSET and _OFFSET_END on outgoing buffers --- gst/audioparsers/gstflacparse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index d65ba062f8..684944bc72 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -1208,17 +1208,25 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBuffer * buffer) flacparse->state = GST_FLAC_PARSE_STATE_DATA; } + /* also cater for oggmux metadata */ if (flacparse->blocking_strategy == 0) { GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (flacparse->sample_number, flacparse->block_size * GST_SECOND, flacparse->samplerate); + GST_BUFFER_OFFSET_END (buffer) = + flacparse->sample_number * flacparse->block_size + + flacparse->block_size; } else { GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (flacparse->sample_number, GST_SECOND, flacparse->samplerate); + 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); /* Minimal size of a frame header */ gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), MAX (16,