diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> | 2016-11-29 15:30:43 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-12-05 11:03:11 +0200 |
commit | f329d44bb7efdb388bc954036d50c8bdf0974811 (patch) | |
tree | e48827c33f6d903f06d53c7de3d625524c055996 | |
parent | b7e0c38f12b4d8a90a8c6c16f70befee73991779 (diff) | |
download | gstreamer-plugins-base-f329d44bb7efdb388bc954036d50c8bdf0974811.tar.gz |
multihandlesink: Fix buffers-queued being off by one
max_buffer_usage is the index of the oldest buffer in the queue,
starting at zero, not the number of buffers queued.
find_limits returns the index of the oldest buffer that satisfies the
limits in its min_idx parameter, not the number of buffers needed. Fix
this use too in order to keep passing the tests that read
buffers-queued.
https://bugzilla.gnome.org/show_bug.cgi?id=775351
-rw-r--r-- | gst/tcp/gstmultihandlesink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/tcp/gstmultihandlesink.c b/gst/tcp/gstmultihandlesink.c index f060f0eaf..901326159 100644 --- a/gst/tcp/gstmultihandlesink.c +++ b/gst/tcp/gstmultihandlesink.c @@ -1783,7 +1783,7 @@ restart: find_limits (mhsink, &usage, mhsink->bytes_min, mhsink->buffers_min, mhsink->time_min, &max, -1, -1, -1); - max_buffer_usage = MAX (max_buffer_usage, usage + 1); + max_buffer_usage = MAX (max_buffer_usage, usage); GST_LOG_OBJECT (sink, "extended queue to %d", max_buffer_usage); } @@ -1832,7 +1832,7 @@ restart: gst_buffer_unref (old); } /* save for stats */ - mhsink->buffers_queued = max_buffer_usage; + mhsink->buffers_queued = max_buffer_usage + 1; CLIENTS_UNLOCK (sink); /* and send a signal to thread if handle_set changed */ |