Re: [PATCH 09/15] core: make media source operations use GrlOperationOptions



Hi,

Just one indentation comment below:

On 02/12/11 19:36, gemont igalia com wrote:
> From: Guillaume Emont <gemont igalia com>
> 
> ---
>  src/grl-media-source.c |  251 +++++++++++++++++++++++++++--------------------
>  src/grl-media-source.h |   59 ++++-------
>  2 files changed, 165 insertions(+), 145 deletions(-)
> 
> diff --git a/src/grl-media-source.c b/src/grl-media-source.c
> index 1860b6f..30bad8b 100644
> --- a/src/grl-media-source.c
> +++ b/src/grl-media-source.c
> @@ -80,7 +80,7 @@ struct FullResolutionCtlCb {
>    GrlMediaSourceResultCb user_callback;
>    gpointer user_data;
>    GList *keys;
> -  GrlMetadataResolutionFlags flags;
> +  GrlOperationOptions *options;
>    gboolean chained;
>    GList *next_index;
>    GList *waiting_list;
> @@ -129,7 +129,7 @@ struct MetadataFullResolutionCtlCb {
>    GrlMediaSourceMetadataCb user_callback;
>    gpointer user_data;
>    GList *keys;
> -  GrlMetadataResolutionFlags flags;
> +  GrlOperationOptions *options;
>    guint metadata_id;
>  };
>  
> @@ -316,6 +316,7 @@ free_browse_operation_spec (GrlMediaSourceBrowseSpec *spec)
>    g_object_unref (spec->source);
>    g_object_unref (spec->container);
>    g_list_free (spec->keys);
> +  g_object_unref (spec->options);
>    g_free (spec);
>  }
>  
> @@ -326,6 +327,7 @@ free_search_operation_spec (GrlMediaSourceSearchSpec *spec)
>    g_object_unref (spec->source);
>    g_free (spec->text);
>    g_list_free (spec->keys);
> +  g_object_unref (spec->options);
>    g_free (spec);
>  }
>  
> @@ -336,6 +338,7 @@ free_query_operation_spec (GrlMediaSourceQuerySpec *spec)
>    g_object_unref (spec->source);
>    g_free (spec->query);
>    g_list_free (spec->keys);
> +  g_object_unref (spec->options);
>    g_free (spec);
>  }
>  
> @@ -503,6 +506,7 @@ media_from_uri_relay_cb (GrlMediaSource *source,
>    g_object_unref (mfsrc->spec->source);
>    g_free (mfsrc->spec->uri);
>    g_list_free (mfsrc->spec->keys);
> +  g_object_unref (mfsrc->spec->options);
>    g_free (mfsrc->spec);
>    g_free (mfsrc);
>  }
> @@ -589,39 +593,41 @@ static void
>  auto_split_run_next_chunk (struct BrowseRelayCb *brc, guint remaining)
>  {
>    struct AutoSplitCtl *as_info = brc->auto_split;
> -  guint *skip = NULL;
> -  guint *count = NULL;
> +  GrlOperationOptions *options = NULL;
>    GSourceFunc operation = NULL;
>    gpointer spec = NULL;
> +  gint count;
> +  guint skip;
>  
>    /* Identify the operation we are handling */
>    if (brc->bspec) {
>      spec = brc->bspec;
> -    skip = &brc->bspec->skip;
> -    count = &brc->bspec->count;
> +    options = brc->bspec->options;
>      operation = browse_idle;
>    } else if (brc->sspec) {
>      spec = brc->sspec;
> -    skip = &brc->sspec->skip;
> -    count = &brc->sspec->count;
> +    options = brc->sspec->options;
>      operation = search_idle;
>    } else if (brc->qspec) {
>      spec = brc->qspec;
> -    skip = &brc->qspec->skip;
> -    count = &brc->qspec->count;
> +    options = brc->qspec->options;
>      operation = query_idle;
>    }
> +  skip = grl_operation_options_get_skip (options);
> +  count = grl_operation_options_get_count (options);
>  
>    /* Go for next chunk */
> -  *skip += as_info->chunk_requested;
> +  skip += as_info->chunk_requested;
>    as_info->chunk_first = TRUE;
>    as_info->chunk_consumed = 0;
>    if (remaining < as_info->threshold) {
>      as_info->chunk_requested = remaining;
>    }
> -  *count = as_info->chunk_requested;
> +  count = as_info->chunk_requested;
>    GRL_DEBUG ("auto-split: requesting next chunk (skip=%u, count=%u)",
> -             *skip, *count);
> +             skip, count);
> +  grl_operation_options_set_skip (options, skip);
> +  grl_operation_options_set_count (options, count);
>    g_idle_add (operation, spec);
>  }
>  
> @@ -864,6 +870,7 @@ metadata_result_relay_cb (GrlMediaSource *source,
>      g_object_unref (mrc->spec->media);
>    }
>    g_list_free (mrc->spec->keys);
> +  g_object_unref (mrc->spec->options);
>    g_free (mrc->spec);
>    g_free (mrc);
>  }
> @@ -1102,6 +1109,7 @@ full_resolution_done_cb (GrlMetadataSource *source,
>  	  }
>  	  /* We are done, free the control information now */
>  	  g_list_free (ctl_info->keys);
> +    g_object_unref (ctl_info->options);

Indentation here seems wrong. Maybe tabs instead of spaces or the other
way around?

>  	  g_free (ctl_info);	}
>        } else {
>  	full_resolution_add_to_waiting_list (&ctl_info->waiting_list,
> @@ -1173,14 +1181,24 @@ full_resolution_ctl_cb (GrlMediaSource *source,
>                   grl_metadata_source_get_name (_source));
[...]

Skipping the rest for readability
-- 
Simon Pena <spena igalia com>
Igalia - Free Software Engineering

Attachment: signature.asc
Description: OpenPGP digital signature



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