playback-tutorial-3/basic-tutorial-8: Fix buffer duration calculations
authorSebastian Dröge <sebastian@centricular.com>
Sat, 9 Dec 2017 12:01:51 +0000 (14:01 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 9 Dec 2017 12:01:51 +0000 (14:01 +0200)
Same as last commit in various other places

https://bugzilla.gnome.org/show_bug.cgi?id=791408

examples/tutorials/playback-tutorial-3.c
markdown/tutorials/basic/short-cutting-the-pipeline.md
markdown/tutorials/playback/short-cutting-the-pipeline.md

index cea556f..0362dc9 100644 (file)
@@ -36,7 +36,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);
index 0c5fcf3..855d4e1 100644 (file)
@@ -131,7 +131,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);
@@ -450,7 +450,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 */
   raw = (gint16 *)GST_BUFFER_DATA (buffer);
index 00f6803..cf37b45 100644 (file)
@@ -57,7 +57,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);