From: Aleksandr Slobodeniuk Date: Fri, 8 Dec 2017 21:07:17 +0000 (+0300) Subject: basic-tutorial-8: Fix buffer duration calculation X-Git-Tag: 1.19.3~489^2~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea888a0e3baa106f926d0ded1fd5501a6aae6bd5;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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);