Commit 2e541b29 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/playback/gstqueue2.c: Fix a division by zero when the max percent is <= 0....

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.
parent 4d835514
2007-06-12 Wim Taymans <wim@fluendo.com>
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.
2007-06-11 Wim Taymans <wim@fluendo.com> 2007-06-11 Wim Taymans <wim@fluendo.com>
   
Based on patch by: Thiago Sousa Santos <thiagossantos at gmail dot com> Based on patch by: Thiago Sousa Santos <thiagossantos at gmail dot com>
...@@ -642,7 +642,7 @@ update_buffering (GstQueue * queue) ...@@ -642,7 +642,7 @@ update_buffering (GstQueue * queue)
gint percent; gint percent;
gboolean post = FALSE; gboolean post = FALSE;
if (!queue->use_buffering) if (!queue->use_buffering || queue->high_percent <= 0)
return; return;
#define GET_PERCENT(format) ((queue->max_level.format) > 0 ? \ #define GET_PERCENT(format) ((queue->max_level.format) > 0 ? \
...@@ -997,8 +997,6 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item) ...@@ -997,8 +997,6 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item)
apply_buffer (queue, buffer, &queue->sink_segment); apply_buffer (queue, buffer, &queue->sink_segment);
/* update the byterate stats */ /* update the byterate stats */
update_rates (queue); update_rates (queue);
/* update the buffering status */
update_buffering (queue);
if (QUEUE_IS_USING_TEMP_FILE (queue)) { if (QUEUE_IS_USING_TEMP_FILE (queue)) {
gst_queue_write_buffer_to_file (queue, buffer); gst_queue_write_buffer_to_file (queue, buffer);
...@@ -1039,9 +1037,14 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item) ...@@ -1039,9 +1037,14 @@ gst_queue_locked_enqueue (GstQueue * queue, gpointer item)
item = NULL; item = NULL;
} }
if (!QUEUE_IS_USING_TEMP_FILE (queue) && item) if (item) {
g_queue_push_tail (queue->queue, item); /* update the buffering status */
GST_QUEUE_SIGNAL_ADD (queue); update_buffering (queue);
if (!QUEUE_IS_USING_TEMP_FILE (queue))
g_queue_push_tail (queue->queue, item);
GST_QUEUE_SIGNAL_ADD (queue);
}
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment