mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
flacparse: set _OFFSET and _OFFSET_END on outgoing buffers
This commit is contained in:
parent
4db789a18c
commit
0d53b6ad62
1 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue