[grilo/fremantle] [core] Do not setup auto-split when count is lower than threshold in search and query opeations.



commit 6fc80a141157aa370177468cd3acd36d78f1dbd8
Author: Iago Toral Quiroga <itoral igalia com>
Date:   Tue Jun 1 16:40:44 2010 +0200

    [core] Do not setup auto-split when count is lower than threshold
    in search and query opeations.

 src/grl-media-source.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index a86c623..fce0c95 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -624,7 +624,10 @@ browse_result_relay_cb (GrlMediaSource *source,
   struct BrowseRelayCb *brc;
   guint plugin_remaining = remaining;
 
-  g_debug ("browse_result_relay_cb");
+  g_debug ("browse_result_relay_cb, op:%u, source:%s, remaining:%u",
+	   browse_id,
+	   grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
+	   remaining);
 
   brc = (struct BrowseRelayCb *) user_data;
 
@@ -734,7 +737,8 @@ browse_result_relay_cb (GrlMediaSource *source,
 
   /* Free callback data when we processed the last result */
   if (remaining == 0) {
-    g_debug ("Got remaining '0' for operation %d", browse_id);
+    g_debug ("Got remaining '0' for operation %d (%s)",
+	     browse_id,  grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)));
     if (brc->bspec) {
       free_browse_operation_spec (brc->bspec);
     } else if (brc->sspec) {
@@ -1326,7 +1330,8 @@ grl_media_source_search (GrlMediaSource *source,
   brc->sspec = ss;
 
   /* Setup auto-split management if requested */
-  if (source->priv->auto_split_threshold > 0) {
+  if (source->priv->auto_split_threshold > 0 &&
+      count > source->priv->auto_split_threshold) {
     g_debug ("auto-split: enabled");
     struct AutoSplitCtl *as_ctl = g_new0 (struct AutoSplitCtl, 1);
     as_ctl->count = count;
@@ -1458,7 +1463,8 @@ grl_media_source_query (GrlMediaSource *source,
   brc->qspec = qs;
 
   /* Setup auto-split management if requested */
-  if (source->priv->auto_split_threshold > 0) {
+  if (source->priv->auto_split_threshold > 0 &&
+      count > source->priv->auto_split_threshold) {
     g_debug ("auto-split: enabled");
     struct AutoSplitCtl *as_ctl = g_new0 (struct AutoSplitCtl, 1);
     as_ctl->count = count;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]