[svn r811] - Fixed indentation to 2 spaces trunk
authorleo_sobral
Wed Aug 15 23:06:55 2007 +0100 (2007-08-15)
branchtrunk
changeset 805a87c760e0dfa
parent 804 4b2192319f56
child 806 d35b50f4d77e
[svn r811] - Fixed indentation to 2 spaces
gst-gmyth/playbinmaemo/gstplaybinmaemo.c
     1.1 --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c	Wed Aug 15 20:52:44 2007 +0100
     1.2 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c	Wed Aug 15 23:06:55 2007 +0100
     1.3 @@ -306,52 +306,51 @@
     1.4  static void
     1.5  prepare_elements (GstPlayBinMaemo *pbm)
     1.6  {
     1.7 -    GstElement *decoder;
     1.8 -    GstElement *queue;
     1.9 +  GstElement *decoder;
    1.10 +  GstElement *queue;
    1.11  
    1.12 -    decoder = gst_element_factory_make ("decodebin2", "decode");
    1.13 -    add_element (pbm, decoder);
    1.14 -    g_signal_connect (G_OBJECT (decoder),
    1.15 -                      "autoplug-continue",
    1.16 -                      G_CALLBACK (autoplug_continue_cb),
    1.17 -                      pbm);
    1.18 +  decoder = gst_element_factory_make ("decodebin2", "decode");
    1.19 +  add_element (pbm, decoder);
    1.20 +  g_signal_connect (G_OBJECT (decoder),
    1.21 +                    "autoplug-continue",
    1.22 +                    G_CALLBACK (autoplug_continue_cb),
    1.23 +                    pbm);
    1.24  
    1.25 -    g_signal_connect (G_OBJECT (decoder),
    1.26 -                      "unknown-type",
    1.27 -                      G_CALLBACK (unknown_type_cb),
    1.28 -                      pbm);
    1.29 +  g_signal_connect (G_OBJECT (decoder),
    1.30 +                    "unknown-type",
    1.31 +                    G_CALLBACK (unknown_type_cb),
    1.32 +                    pbm);
    1.33  
    1.34 -    g_signal_connect (G_OBJECT (decoder),
    1.35 -                      "new-decoded-pad",
    1.36 -                      G_CALLBACK (new_decoded_pad_cb),
    1.37 -                      pbm);
    1.38 +  g_signal_connect (G_OBJECT (decoder),
    1.39 +                    "new-decoded-pad",
    1.40 +                    G_CALLBACK (new_decoded_pad_cb),
    1.41 +                    pbm);
    1.42  
    1.43 -    queue = gst_element_factory_make ("queue", NULL);
    1.44 -    add_element (pbm, queue);
    1.45 +  queue = gst_element_factory_make ("queue", NULL);
    1.46 +  add_element (pbm, queue);
    1.47  
    1.48 -    if (gst_element_link_many (pbm->source, queue, decoder, NULL) == FALSE) {
    1.49 -        g_warning ("FAIL TO LINK SRC WITH DECODEBIN2");
    1.50 -    }
    1.51 +  if (gst_element_link_many (pbm->source, queue, decoder, NULL) == FALSE) {
    1.52 +    g_warning ("FAIL TO LINK SRC WITH DECODEBIN2");
    1.53 +  }
    1.54  }
    1.55  
    1.56  static gboolean
    1.57  setup_source (GstPlayBinMaemo *pbm)
    1.58  {
    1.59 -    if (!pbm->need_rebuild)
    1.60 -        return TRUE;
    1.61 +  if (!pbm->need_rebuild)
    1.62 +    return TRUE;
    1.63  
    1.64 -    clear_elements (pbm);
    1.65 +  clear_elements (pbm);
    1.66  
    1.67 -    GST_DEBUG_OBJECT (pbm, "setup source");
    1.68 +  GST_DEBUG_OBJECT (pbm, "setup source");
    1.69  
    1.70 -    pbm->has_metadata = FALSE;
    1.71 +  pbm->has_metadata = FALSE;
    1.72  
    1.73 -    /* create and configure an element that can handle the uri */
    1.74 -    if (!(pbm->source = gen_source_element (pbm)))
    1.75 -        goto no_source;
    1.76 +  /* create and configure an element that can handle the uri */
    1.77 +  if (!(pbm->source = gen_source_element (pbm)))
    1.78 +    goto no_source;
    1.79  
    1.80 -
    1.81 -    add_element (pbm, pbm->source);
    1.82 +  add_element (pbm, pbm->source);
    1.83  
    1.84  
    1.85  #if 0
    1.86 @@ -361,12 +360,12 @@
    1.87      }
    1.88  #endif
    1.89  
    1.90 -    prepare_elements (pbm);
    1.91 +  prepare_elements (pbm);
    1.92  
    1.93 -    return TRUE;
    1.94 +  return TRUE;
    1.95  
    1.96  no_source:
    1.97 -    return FALSE;
    1.98 +  return FALSE;
    1.99  }
   1.100  
   1.101  static void
   1.102 @@ -458,14 +457,14 @@
   1.103        g_value_set_object (value, play_bin_maemo->source);
   1.104        break;
   1.105      case ARG_VOLUME:
   1.106 -      {
   1.107 +    {
   1.108        gdouble volume  = 0;
   1.109        if (play_bin_maemo->volume > 0) {
   1.110            volume = play_bin_maemo->volume / 65535;
   1.111        }
   1.112        g_value_set_double (value, volume);
   1.113        break;
   1.114 -      }
   1.115 +    }
   1.116      case ARG_XID:
   1.117        g_value_set_long (value, play_bin_maemo->xid);
   1.118        break;
   1.119 @@ -528,23 +527,23 @@
   1.120  factory_filter_sinks (GstPluginFeature *feature,
   1.121                        GstPlayBinMaemo *pbm)
   1.122  {
   1.123 -    guint rank;
   1.124 -    const gchar *klass;
   1.125 +  guint rank;
   1.126 +  const gchar *klass;
   1.127  
   1.128 -    if (!GST_IS_ELEMENT_FACTORY (feature))
   1.129 -        return FALSE;
   1.130 +  if (!GST_IS_ELEMENT_FACTORY (feature))
   1.131 +    return FALSE;
   1.132  
   1.133 -    klass = gst_element_factory_get_klass (GST_ELEMENT_FACTORY (feature));
   1.134 +  klass = gst_element_factory_get_klass (GST_ELEMENT_FACTORY (feature));
   1.135  
   1.136 -    if ((strstr (klass, "Sink/Video") == NULL) && (strstr (klass, "Sink/Audio") == NULL))
   1.137 -        return FALSE;
   1.138 +  if ((strstr (klass, "Sink/Video") == NULL) && (strstr (klass, "Sink/Audio") == NULL))
   1.139 +    return FALSE;
   1.140  
   1.141 -    g_debug ("Filtered: %s", gst_element_factory_get_longname ((GST_ELEMENT_FACTORY (feature))));
   1.142 -    rank = gst_plugin_feature_get_rank (feature);
   1.143 -    if (rank < GST_RANK_MARGINAL)
   1.144 -        return FALSE;
   1.145 +  g_debug ("Filtered: %s", gst_element_factory_get_longname ((GST_ELEMENT_FACTORY (feature))));
   1.146 +  rank = gst_plugin_feature_get_rank (feature);
   1.147 +  if (rank < GST_RANK_MARGINAL)
   1.148 +    return FALSE;
   1.149  
   1.150 -    return TRUE;
   1.151 +  return TRUE;
   1.152  }
   1.153  
   1.154  static gint
   1.155 @@ -650,7 +649,7 @@
   1.156                   GstCaps *caps,
   1.157                   gpointer user_data)
   1.158  {
   1.159 -    g_debug ("unknown_type_cb: %s", gst_caps_to_string (caps));
   1.160 +  g_debug ("unknown_type_cb: %s", gst_caps_to_string (caps));
   1.161  }
   1.162  
   1.163  static GstPad *
   1.164 @@ -673,93 +672,93 @@
   1.165  static GstElement*
   1.166  create_element (GstPlayBinMaemo *pbm, GstElementFactory *factory)
   1.167  {
   1.168 -    GstElement *queue;
   1.169 -    GstElement *bin = NULL;
   1.170 -    GstElement *element;
   1.171 -    GstPad *pad;
   1.172 +  GstElement *queue;
   1.173 +  GstElement *bin = NULL;
   1.174 +  GstElement *element;
   1.175 +  GstPad *pad;
   1.176  
   1.177 -    element = gst_element_factory_create (factory, NULL);
   1.178 -    if (element == NULL)
   1.179 -        return NULL;
   1.180 +  element = gst_element_factory_create (factory, NULL);
   1.181 +  if (element == NULL)
   1.182 +    return NULL;
   1.183  
   1.184  
   1.185 -    bin = gst_bin_new (NULL);
   1.186 +  bin = gst_bin_new (NULL);
   1.187  
   1.188 -    queue = gst_element_factory_make ("queue", NULL);
   1.189 -    gst_bin_add (GST_BIN (bin), queue);
   1.190 +  queue = gst_element_factory_make ("queue", NULL);
   1.191 +  gst_bin_add (GST_BIN (bin), queue);
   1.192  
   1.193 -    if (strstr (gst_element_factory_get_klass (factory), "Sink/Video") != NULL) {
   1.194 -        GstElement *colorspace;
   1.195 +  if (strstr (gst_element_factory_get_klass (factory), "Sink/Video") != NULL) {
   1.196 +    GstElement *colorspace;
   1.197  
   1.198 -        colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
   1.199 +    colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
   1.200  
   1.201 -        gst_bin_add (GST_BIN (bin), colorspace);
   1.202 -        if (gst_element_link (queue, colorspace) == FALSE) {
   1.203 -            GST_WARNING_OBJECT (pbm, "Fail to link queue and colorspace");
   1.204 -            gst_element_set_state (colorspace, GST_STATE_NULL);
   1.205 -            gst_object_unref (colorspace);
   1.206 -            goto error;
   1.207 -        }
   1.208 -
   1.209 -        gst_bin_add (GST_BIN (bin), element);
   1.210 -        if (gst_element_link (colorspace, element) == FALSE) {
   1.211 -            GST_WARNING_OBJECT (pbm, "Fail to link colorspace and sink video: %s", GST_ELEMENT_NAME (element));
   1.212 -            gst_element_set_state (colorspace, GST_STATE_NULL);
   1.213 -            gst_object_unref (colorspace);
   1.214 -            goto error;
   1.215 -        }
   1.216 -
   1.217 -        pbm->sink_video = element;
   1.218 -        update_xid (pbm);
   1.219 -
   1.220 -    } else if (strstr (gst_element_factory_get_klass (factory), "Sink/Audio") != NULL) {
   1.221 -        GParamSpec *vol_spec;
   1.222 -        GstElement *prev;
   1.223 -
   1.224 -        prev = queue;
   1.225 -        vol_spec = g_object_class_find_property (G_OBJECT_GET_CLASS (element), "volume");
   1.226 -        if (vol_spec == NULL) {
   1.227 -            GstElement *volume;
   1.228 -
   1.229 -            bin = gst_bin_new (NULL);
   1.230 -            volume = gst_element_factory_make ("volume", "volume");
   1.231 -            gst_bin_add (GST_BIN (bin), volume);
   1.232 -            if (gst_element_link (queue, volume) == FALSE) {
   1.233 -                GST_WARNING_OBJECT (pbm, "Fail to link queue and volume");
   1.234 -                gst_element_set_state (volume, GST_STATE_NULL);
   1.235 -                gst_object_unref (volume);
   1.236 -                goto error;
   1.237 -            }
   1.238 -
   1.239 -            prev = volume;
   1.240 -            g_param_spec_unref (vol_spec);
   1.241 -        }
   1.242 -
   1.243 -        gst_bin_add (GST_BIN (bin), element);
   1.244 -        if (gst_element_link (prev, element) == FALSE) {
   1.245 -           GST_WARNING_OBJECT (pbm, "Fail to link volume and sink audio: %s", GST_ELEMENT_NAME (element));
   1.246 -           if (prev != queue) {
   1.247 -               gst_element_set_state (prev, GST_STATE_NULL);
   1.248 -               gst_object_unref (prev);
   1.249 -           }
   1.250 -           goto error;
   1.251 -        }
   1.252 -
   1.253 -        pbm->volume_element = (prev != queue) ? prev : element;
   1.254 -        update_volume (pbm);
   1.255 +    gst_bin_add (GST_BIN (bin), colorspace);
   1.256 +    if (gst_element_link (queue, colorspace) == FALSE) {
   1.257 +      GST_WARNING_OBJECT (pbm, "Fail to link queue and colorspace");
   1.258 +      gst_element_set_state (colorspace, GST_STATE_NULL);
   1.259 +      gst_object_unref (colorspace);
   1.260 +      goto error;
   1.261      }
   1.262  
   1.263 -    pad = gst_element_get_pad (queue, "sink");
   1.264 -    gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));
   1.265 -    gst_object_unref (pad);
   1.266 +    gst_bin_add (GST_BIN (bin), element);
   1.267 +    if (gst_element_link (colorspace, element) == FALSE) {
   1.268 +      GST_WARNING_OBJECT (pbm, "Fail to link colorspace and sink video: %s", GST_ELEMENT_NAME (element));
   1.269 +      gst_element_set_state (colorspace, GST_STATE_NULL);
   1.270 +      gst_object_unref (colorspace);
   1.271 +      goto error;
   1.272 +    }
   1.273  
   1.274 -    return bin;
   1.275 +    pbm->video_sink = element;
   1.276 +    update_xid (pbm);
   1.277 +
   1.278 +  } else if (strstr (gst_element_factory_get_klass (factory), "Sink/Audio") != NULL) {
   1.279 +    GParamSpec *vol_spec;
   1.280 +    GstElement *prev;
   1.281 +
   1.282 +    prev = queue;
   1.283 +    vol_spec = g_object_class_find_property (G_OBJECT_GET_CLASS (element), "volume");
   1.284 +    if (vol_spec == NULL) {
   1.285 +      GstElement *volume;
   1.286 +
   1.287 +      bin = gst_bin_new (NULL);
   1.288 +      volume = gst_element_factory_make ("volume", "volume");
   1.289 +      gst_bin_add (GST_BIN (bin), volume);
   1.290 +      if (gst_element_link (queue, volume) == FALSE) {
   1.291 +        GST_WARNING_OBJECT (pbm, "Fail to link queue and volume");
   1.292 +        gst_element_set_state (volume, GST_STATE_NULL);
   1.293 +        gst_object_unref (volume);
   1.294 +        goto error;
   1.295 +      }
   1.296 +
   1.297 +      prev = volume;
   1.298 +      g_param_spec_unref (vol_spec);
   1.299 +    }
   1.300 +
   1.301 +    gst_bin_add (GST_BIN (bin), element);
   1.302 +    if (gst_element_link (prev, element) == FALSE) {
   1.303 +      GST_WARNING_OBJECT (pbm, "Fail to link volume and sink audio: %s", GST_ELEMENT_NAME (element));
   1.304 +      if (prev != queue) {
   1.305 +        gst_element_set_state (prev, GST_STATE_NULL);
   1.306 +        gst_object_unref (prev);
   1.307 +      }
   1.308 +      goto error;
   1.309 +    }
   1.310 +
   1.311 +    pbm->volume_element = (prev != queue) ? prev : element;
   1.312 +    update_volume (pbm);
   1.313 +  }
   1.314 +
   1.315 +  pad = gst_element_get_pad (queue, "sink");
   1.316 +  gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));
   1.317 +  gst_object_unref (pad);
   1.318 +
   1.319 +  return bin;
   1.320  error:
   1.321  
   1.322 -    gst_element_set_state (bin, GST_STATE_NULL);
   1.323 -    gst_object_unref (bin);
   1.324 +  gst_element_set_state (bin, GST_STATE_NULL);
   1.325 +  gst_object_unref (bin);
   1.326  
   1.327 -    return NULL;
   1.328 +  return NULL;
   1.329  }
   1.330  
   1.331  static void
   1.332 @@ -768,172 +767,172 @@
   1.333                      gboolean arg,
   1.334                      gpointer user_data)
   1.335  {
   1.336 -    GList *comp = NULL;
   1.337 -    GList *walk;
   1.338 -    GstCaps *caps;
   1.339 -    gboolean linked;
   1.340 -    GstPlayBinMaemo *pbm;
   1.341 +  GList *comp = NULL;
   1.342 +  GList *walk;
   1.343 +  GstCaps *caps;
   1.344 +  gboolean linked;
   1.345 +  GstPlayBinMaemo *pbm;
   1.346  
   1.347 -    pbm = GST_PLAY_BIN_MAEMO (user_data);
   1.348 -    caps = gst_pad_get_caps (pad);
   1.349 +  pbm = GST_PLAY_BIN_MAEMO (user_data);
   1.350 +  caps = gst_pad_get_caps (pad);
   1.351  
   1.352 -    g_debug ("new_decoded_pad_cb: %s", gst_caps_to_string (caps));
   1.353 +  g_debug ("new_decoded_pad_cb: %s", gst_caps_to_string (caps));
   1.354  
   1.355 -    comp = find_compatibles (GST_PLAY_BIN_MAEMO (user_data), caps);
   1.356 +  comp = find_compatibles (GST_PLAY_BIN_MAEMO (user_data), caps);
   1.357  
   1.358  
   1.359 -    if (comp == NULL) {
   1.360 -        g_warning ("flow error: dont find comaptible");
   1.361 -        return;
   1.362 +  if (comp == NULL) {
   1.363 +    g_warning ("flow error: dont find comaptible");
   1.364 +    return;
   1.365 +  }
   1.366 +
   1.367 +  GST_PAD_STREAM_LOCK (pad);
   1.368 +
   1.369 +  linked = FALSE;
   1.370 +  for (walk=comp; walk != NULL; walk = walk->next) {
   1.371 +    GstElementFactory *factory = (GstElementFactory *) walk->data;
   1.372 +    GstElement *element;
   1.373 +    GstPad *sinkpad = NULL;
   1.374 +
   1.375 +    if ((element = create_element (pbm, factory)) == NULL) {
   1.376 +      GST_WARNING_OBJECT (pbm, "Could not create an element from %s",
   1.377 +          gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
   1.378 +      g_debug ("Could not create an element from %s",
   1.379 +          gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
   1.380 +
   1.381 +      continue;
   1.382      }
   1.383  
   1.384 -    GST_PAD_STREAM_LOCK (pad);
   1.385 -
   1.386 -    linked = FALSE;
   1.387 -    for (walk=comp; walk != NULL; walk = walk->next) {
   1.388 -        GstElementFactory *factory = (GstElementFactory *) walk->data;
   1.389 -        GstElement *element;
   1.390 -        GstPad *sinkpad = NULL;
   1.391 -
   1.392 -        if ((element = create_element (pbm, factory)) == NULL) {
   1.393 -            GST_WARNING_OBJECT (pbm, "Could not create an element from %s",
   1.394 -                gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
   1.395 -            g_debug ("Could not create an element from %s",
   1.396 -                gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
   1.397 -
   1.398 -            continue;
   1.399 -        }
   1.400 -
   1.401 -        if (!(add_element (GST_PLAY_BIN_MAEMO (user_data), element))) {
   1.402 -            GST_WARNING_OBJECT (pbm, "Couldn't set %s to READY", GST_ELEMENT_NAME (element));
   1.403 -            gst_object_unref (element);
   1.404 -            continue;
   1.405 -        }
   1.406 -
   1.407 -        if ((gst_element_set_state (element, GST_STATE_READY))
   1.408 -                         == GST_STATE_CHANGE_FAILURE) {
   1.409 -            gst_element_set_state (element, GST_STATE_NULL);
   1.410 -            gst_object_unref (sinkpad);
   1.411 -            gst_bin_remove (GST_BIN (user_data), element);
   1.412 -            continue;
   1.413 -        }
   1.414 -
   1.415 -        if (!(sinkpad = find_sink_pad (element))) {
   1.416 -            GST_WARNING_OBJECT (pbm, "Element %s doesn't have a sink pad", GST_ELEMENT_NAME (element));
   1.417 -            g_debug ("Element %s doesn't have a sink pad", GST_ELEMENT_NAME (element));
   1.418 -            gst_object_unref (element);
   1.419 -            continue;
   1.420 -        }
   1.421 -
   1.422 -
   1.423 -        if ((gst_pad_link (pad, sinkpad)) != GST_PAD_LINK_OK) {
   1.424 -            GST_WARNING_OBJECT (pbm, "Link failed on pad %s:%s", GST_DEBUG_PAD_NAME (sinkpad));
   1.425 -            gst_element_set_state (element, GST_STATE_NULL);
   1.426 -            gst_object_unref (sinkpad);
   1.427 -            gst_bin_remove (GST_BIN (user_data), element);
   1.428 -            continue;
   1.429 -        }
   1.430 -
   1.431 -        gst_object_unref (sinkpad);
   1.432 -
   1.433 -        if ((gst_element_set_state (element, GST_STATE_PAUSED)) == GST_STATE_CHANGE_FAILURE) {
   1.434 -            gst_element_set_state (element, GST_STATE_NULL);
   1.435 -            gst_bin_remove (GST_BIN (user_data), element);
   1.436 -            continue;
   1.437 -        }
   1.438 -
   1.439 -        linked = TRUE;
   1.440 -        break;
   1.441 +    if (!(add_element (GST_PLAY_BIN_MAEMO (user_data), element))) {
   1.442 +      GST_WARNING_OBJECT (pbm, "Couldn't set %s to READY", GST_ELEMENT_NAME (element));
   1.443 +      gst_object_unref (element);
   1.444 +      continue;
   1.445      }
   1.446  
   1.447 -    g_list_free (comp);
   1.448 -    if (linked == FALSE) {
   1.449 -        g_warning ("GstFlow ERROR");
   1.450 +    if ((gst_element_set_state (element, GST_STATE_READY))
   1.451 +                   == GST_STATE_CHANGE_FAILURE) {
   1.452 +      gst_element_set_state (element, GST_STATE_NULL);
   1.453 +      gst_object_unref (sinkpad);
   1.454 +      gst_bin_remove (GST_BIN (user_data), element);
   1.455 +      continue;
   1.456      }
   1.457 -    GST_PAD_STREAM_UNLOCK (pad);
   1.458 +
   1.459 +    if (!(sinkpad = find_sink_pad (element))) {
   1.460 +      GST_WARNING_OBJECT (pbm, "Element %s doesn't have a sink pad", GST_ELEMENT_NAME (element));
   1.461 +      g_debug ("Element %s doesn't have a sink pad", GST_ELEMENT_NAME (element));
   1.462 +      gst_object_unref (element);
   1.463 +      continue;
   1.464 +    }
   1.465 +
   1.466 +
   1.467 +    if ((gst_pad_link (pad, sinkpad)) != GST_PAD_LINK_OK) {
   1.468 +        GST_WARNING_OBJECT (pbm, "Link failed on pad %s:%s", GST_DEBUG_PAD_NAME (sinkpad));
   1.469 +        gst_element_set_state (element, GST_STATE_NULL);
   1.470 +        gst_object_unref (sinkpad);
   1.471 +        gst_bin_remove (GST_BIN (user_data), element);
   1.472 +      continue;
   1.473 +    }
   1.474 +
   1.475 +    gst_object_unref (sinkpad);
   1.476 +
   1.477 +    if ((gst_element_set_state (element, GST_STATE_PAUSED)) == GST_STATE_CHANGE_FAILURE) {
   1.478 +        gst_element_set_state (element, GST_STATE_NULL);
   1.479 +        gst_bin_remove (GST_BIN (user_data), element);
   1.480 +      continue;
   1.481 +    }
   1.482 +
   1.483 +    linked = TRUE;
   1.484 +    break;
   1.485 +  }
   1.486 +
   1.487 +  g_list_free (comp);
   1.488 +  if (linked == FALSE) {
   1.489 +    g_warning ("GstFlow ERROR");
   1.490 +  }
   1.491 +  GST_PAD_STREAM_UNLOCK (pad);
   1.492  }
   1.493  
   1.494  static void
   1.495  update_volume (GstPlayBinMaemo *pbm)
   1.496  {
   1.497 -    if (pbm->volume_element != NULL) {
   1.498 -        if (pbm->volume > 0) {
   1.499 -            g_object_set (G_OBJECT (pbm->volume_element),
   1.500 -                          "volume", pbm->volume,
   1.501 -                          NULL);
   1.502 -        } else {
   1.503 -            g_object_set (G_OBJECT (pbm->volume_element),
   1.504 -                          "mute", TRUE,
   1.505 -                          NULL);
   1.506 -        }
   1.507 +  if (pbm->volume_element != NULL) {
   1.508 +    if (pbm->volume > 0) {
   1.509 +      g_object_set (G_OBJECT (pbm->volume_element),
   1.510 +                    "volume", pbm->volume,
   1.511 +                    NULL);
   1.512 +    } else {
   1.513 +      g_object_set (G_OBJECT (pbm->volume_element),
   1.514 +                    "mute", TRUE,
   1.515 +                    NULL);
   1.516      }
   1.517 +  }
   1.518  }
   1.519  
   1.520  static void
   1.521  update_xid (GstPlayBinMaemo *pbm)
   1.522  {
   1.523 -    if ((pbm->sink_video != NULL) &&
   1.524 -        (pbm->xid != -1) &&
   1.525 -        (GST_IS_X_OVERLAY (pbm->sink_video))) {
   1.526 +  if ((pbm->video_sink != NULL) &&
   1.527 +    (pbm->xid != -1) &&
   1.528 +    (GST_IS_X_OVERLAY (pbm->video_sink))) {
   1.529  
   1.530 -        Display *display;
   1.531 -        g_object_set (G_OBJECT (pbm->sink_video),
   1.532 -                      "force-aspect-ratio", TRUE, NULL);
   1.533 -        display = XOpenDisplay(NULL);
   1.534 -        XMapRaised(display, pbm->xid);
   1.535 -        XSync (display, FALSE);
   1.536 +    Display *display;
   1.537 +    g_object_set (G_OBJECT (pbm->video_sink),
   1.538 +                  "force-aspect-ratio", TRUE, NULL);
   1.539 +    display = XOpenDisplay(NULL);
   1.540 +    XMapRaised(display, pbm->xid);
   1.541 +    XSync (display, FALSE);
   1.542  
   1.543 -        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (pbm->sink_video),
   1.544 -                                      pbm->xid);
   1.545 -    }
   1.546 +    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (pbm->video_sink),
   1.547 +                                  pbm->xid);
   1.548 +  }
   1.549  }
   1.550  
   1.551  static gboolean
   1.552  add_element (GstPlayBinMaemo *pbm,
   1.553               GstElement *child)
   1.554  {
   1.555 -    if (gst_bin_add (GST_BIN (pbm), child)) {
   1.556 -        pbm->elements = g_list_append (pbm->elements, child);
   1.557 -        return TRUE;
   1.558 -    }
   1.559 -    return FALSE;
   1.560 +  if (gst_bin_add (GST_BIN (pbm), child)) {
   1.561 +    pbm->elements = g_list_append (pbm->elements, child);
   1.562 +    return TRUE;
   1.563 +  }
   1.564 +  return FALSE;
   1.565  }
   1.566  
   1.567  static void
   1.568  clear_elements (GstPlayBinMaemo *pbm)
   1.569  {
   1.570 -    GList *walk;
   1.571 +  GList *walk;
   1.572  
   1.573 -    walk = pbm->elements;
   1.574 +  walk = pbm->elements;
   1.575  
   1.576 -    for (; walk != NULL; walk = walk->next) {
   1.577 -        GstElement *e = GST_ELEMENT (walk->data);
   1.578 +  for (; walk != NULL; walk = walk->next) {
   1.579 +    GstElement *e = GST_ELEMENT (walk->data);
   1.580  
   1.581 -        gst_element_set_state (e, GST_STATE_NULL);
   1.582 -        gst_bin_remove (GST_BIN (pbm), e);
   1.583 -    }
   1.584 +    gst_element_set_state (e, GST_STATE_NULL);
   1.585 +    gst_bin_remove (GST_BIN (pbm), e);
   1.586 +  }
   1.587  
   1.588 -    g_list_free (pbm->elements);
   1.589 -    pbm->elements = NULL;
   1.590 -    pbm->source = NULL;
   1.591 -    pbm->volume_element = NULL;
   1.592 -    pbm->sink_video = NULL;
   1.593 +  g_list_free (pbm->elements);
   1.594 +  pbm->elements = NULL;
   1.595 +  pbm->source = NULL;
   1.596 +  pbm->volume_element = NULL;
   1.597 +  pbm->video_sink = NULL;
   1.598  }
   1.599  
   1.600  static gboolean
   1.601  plugin_init(GstPlugin * plugin)
   1.602  {
   1.603  #ifdef ENABLE_NLS
   1.604 -    setlocale(LC_ALL, "");
   1.605 -    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
   1.606 +  setlocale(LC_ALL, "");
   1.607 +  bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
   1.608  #endif                          /* ENABLE_NLS */
   1.609  
   1.610 -    if (!gst_element_register(plugin, "playbinmaemo", GST_RANK_SECONDARY,
   1.611 -                              GST_TYPE_PLAY_BIN_MAEMO)) {
   1.612 -        return FALSE;
   1.613 -    }
   1.614 +  if (!gst_element_register(plugin, "playbinmaemo", GST_RANK_SECONDARY,
   1.615 +                          GST_TYPE_PLAY_BIN_MAEMO)) {
   1.616 +    return FALSE;
   1.617 +  }
   1.618  
   1.619 -    return TRUE;
   1.620 +  return TRUE;
   1.621  }
   1.622  
   1.623  GST_PLUGIN_DEFINE(GST_VERSION_MAJOR,