summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-06-12 08:38:06 +0000
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-29 11:17:13 +0100
commitc26bff1afcb662ff203e322a79cb967e6a041b0c (patch)
tree602deb9fcea37279f8e83bf5d9022e7fe682f6d1 /gst
parent27d8c5843830d68af348e770860fdd5cc25dd2d1 (diff)
gst/playback/gstqueue2.c: Fix a division by zero when the max percent is <= 0. Fixes #446572. also update the bufferi...
Original commit message from CVS: Patches by: Thiago Sousa Santos <thiagossantos at gmail dot com> * gst/playback/gstqueue2.c: (update_buffering), (gst_queue_locked_enqueue): Fix a division by zero when the max percent is <= 0. Fixes #446572. also update the buffering status when receiving events. Fixes #446551.
Diffstat (limited to 'gst')
-rw-r--r--gst/playback/gstqueue2.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gst/playback/gstqueue2.c b/gst/playback/gstqueue2.c
index bf52907f9c..d512d80fcf 100644
--- a/gst/playback/gstqueue2.c
+++ b/gst/playback/gstqueue2.c
@@ -642,7 +642,7 @@ update_buffering (GstQueue * queue)
gint percent;
gboolean post = FALSE;
- if (!queue->use_buffering)
+ if (!queue->use_buffering || queue->high_percent <= 0)
return;
#define GET_PERCENT(format) ((queue->max_level.format) > 0 ? \
@@ -997,8 +997,6 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item)
apply_buffer (queue, buffer, &queue->sink_segment);
/* update the byterate stats */
update_rates (queue);
- /* update the buffering status */
- update_buffering (queue);
if (QUEUE_IS_USING_TEMP_FILE (queue)) {
gst_queue_write_buffer_to_file (queue, buffer);
@@ -1039,9 +1037,14 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item)
item = NULL;
}
- if (!QUEUE_IS_USING_TEMP_FILE (queue) && item)
- g_queue_push_tail (queue->queue, item);
- GST_QUEUE_SIGNAL_ADD (queue);
+ if (item) {
+ /* update the buffering status */
+ update_buffering (queue);
+
+ if (!QUEUE_IS_USING_TEMP_FILE (queue))
+ g_queue_push_tail (queue->queue, item);
+ GST_QUEUE_SIGNAL_ADD (queue);
+ }
return;