summaryrefslogtreecommitdiff
path: root/gst/audiotestsrc
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-05-22 23:24:55 -0400
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-05-25 08:19:02 +0000
commitb46718b1a041250a24dec339473e5da51a569bc8 (patch)
tree84dc3cc4317f68e48056e3888aa830e8325b0a4f /gst/audiotestsrc
parenteed54928c8f9cb08164c66993a44ba0d696eac5e (diff)
downloadgstreamer-plugins-base-b46718b1a041250a24dec339473e5da51a569bc8.tar.gz
audiotestsrc: Fix the way we compute EOS in reverse playback
In reverse playback we were not taking into account the current buffer samples to check if we had reached EOS which was leading to a buffer with PTS = CLOCK_TIME_NONE containing too many frames followed by a useless buffer with pts=0 duration=0, and a g_critical issue in gst_object_sync_values. Also add a validate based test case. Without that patch this is how the expectation fails: ``` diff --- log-asink-sink-expected 2020-05-22 23:22:42.654384579 -0400 +++ log-asink-sink-actual 2020-05-22 23:29:35.671586380 -0400 @@ -27,5 +27,6 @@ buffer: pts=0:00:00.058820861, due=0:00:00.023219955, flags=discont buffer: pts=0:00:00.035600907, due=0:00:00.023219954, flags=discont buffer: pts=0:00:00.012380952, due=0:00:00.023219955, flags=discont -buffer: pts=0:00:00.000000000, due=0:00:00.012380952, flags=discont +buffer: due=0:00:00.012380953, flags=discont +buffer: pts=0:00:00.000000000, flags=discont event eos: (no structure) ``` Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/667>
Diffstat (limited to 'gst/audiotestsrc')
-rw-r--r--gst/audiotestsrc/gstaudiotestsrc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c
index b06b336cc..00645eb20 100644
--- a/gst/audiotestsrc/gstaudiotestsrc.c
+++ b/gst/audiotestsrc/gstaudiotestsrc.c
@@ -1489,10 +1489,10 @@ gst_audio_test_src_fill (GstBaseSrc * basesrc, guint64 offset,
next_sample = src->sample_stop;
src->eos_reached = TRUE;
} else if (src->check_seek_stop && src->reverse &&
- (src->sample_stop > src->next_sample)
+ (src->sample_stop >= (src->next_sample - samples))
) {
/* calculate only partial buffer */
- src->generate_samples_per_buffer = src->sample_stop - src->next_sample;
+ src->generate_samples_per_buffer = src->next_sample - src->sample_stop;
next_sample = src->sample_stop;
src->eos_reached = TRUE;
} else {