mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-14 11:25:39 +00:00
basic-tutorial-8: Fix buffer duration calculation
Buffer duration was counted from buffer's size in bytes, like it were number of samples. https://bugzilla.gnome.org/show_bug.cgi?id=791408
This commit is contained in:
parent
a20b2cc27a
commit
ea888a0e3b
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ static gboolean push_data (CustomData *data) {
|
|||
|
||||
/* Set its timestamp and duration */
|
||||
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (data->num_samples, GST_SECOND, SAMPLE_RATE);
|
||||
GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (CHUNK_SIZE, GST_SECOND, SAMPLE_RATE);
|
||||
GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (num_samples, GST_SECOND, SAMPLE_RATE);
|
||||
|
||||
/* Generate some psychodelic waveforms */
|
||||
gst_buffer_map (buffer, &map, GST_MAP_WRITE);
|
||||
|
|
Loading…
Reference in a new issue