summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandr Slobodeniuk <alenuke@yandex.ru>2017-12-09 00:07:17 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-12-09 14:01:34 +0200
commitea888a0e3baa106f926d0ded1fd5501a6aae6bd5 (patch)
treef88aa8939b069bcdec006cabff369d50c058ea09
parenta20b2cc27a012f31e3aac55d7692aee3b7f9bd38 (diff)
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
-rw-r--r--examples/tutorials/basic-tutorial-8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/tutorials/basic-tutorial-8.c b/examples/tutorials/basic-tutorial-8.c
index f7649c2..611acab 100644
--- a/examples/tutorials/basic-tutorial-8.c
+++ b/examples/tutorials/basic-tutorial-8.c
@@ -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);