rem: g_object_get (info, "object", &pad, NULL);  if (!pad) g_object_get (info, "pad", &pad, NULL); if (pad != NULL && GST_PAD_REALIZE (pad) != NULL) { g_assert (GST_IS_PAD (pad));
add: videopad = NULL; g_object_get (info, "object", &videopad, NULL);  if (!videopad) g_object_get (info, "pad", &videopad, NULL); } } }
context: state_change (GstElement *play, GstElementState old_state,	      GstElementState new_state, BaconVideoWidget *bvw){  if (old_state == GST_STATE_PLAYING) {    if (bvw->priv->update_id != 0) {      g_source_remove (bvw->priv->update_id);      bvw->priv->update_id = 0;    }  } else if (new_state == GST_STATE_PLAYING) {    if (bvw->priv->update_id != 0)      g_source_remove (bvw->priv->update_id);    bvw->priv->update_id = g_idle_add ((GSourceFunc) cb_iterate, bvw);  }  if (old_state <= GST_STATE_READY &&      new_state >= GST_STATE_PAUSED) {    GList *streaminfo = NULL;    g_object_get (G_OBJECT (bvw->priv->play), "stream-info",		  &streaminfo, NULL);    for ( ; streaminfo != NULL; streaminfo = streaminfo->next) {      GObject *info = streaminfo->data;      gint type;      GParamSpec *pspec;      GEnumValue *val;      g_object_get (info, "type", &type, NULL);      pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (info), "type");      val = g_enum_get_value (G_PARAM_SPEC_ENUM (pspec)->enum_class, type);      if (strstr (val->value_name, "AUDIO")) {        bvw->priv->media_has_audio = TRUE;      } else if (strstr (val->value_name, "VIDEO")) {        GstPad *pad = NULL;        g_object_get (info, "object", &pad, NULL);        /* hack for 0.8.5 */        if (!pad)          g_object_get (info, "pad", &pad, NULL);        if (pad != NULL && GST_PAD_REALIZE (pad) != NULL) {          g_assert (GST_IS_PAD (pad));          /* handle explicit caps as well - they're set later */          if (GST_PAD_REALIZE (pad)->link != NULL && GST_PAD_CAPS (pad))            caps_set (G_OBJECT (pad), NULL, bvw);          else            g_signal_connect (pad, "notify::caps",                G_CALLBACK (caps_set), bvw);        }        bvw->priv->media_has_video = TRUE;      }    }  } else if (new_state <= GST_STATE_READY &&             old_state >= GST_STATE_PAUSED) {    bvw->priv->media_has_video = FALSE;    bvw->priv->media_has_audio = FALSE;    /* clean metadata cache */    if (bvw->priv->tagcache)      {        gst_tag_list_free (bvw->priv->tagcache);        bvw->priv->tagcache = NULL;      }    bvw->priv->video_width = 0;    bvw->priv->video_height = 0;  }}