rem: switch (type) { case BVW_INFO_TITLE: string = g_hash_table_lookup(bvw->priv->metadata_hash, "title"); break; case BVW_INFO_ARTIST: string = g_hash_table_lookup(bvw->priv->metadata_hash, "artist"); break; case BVW_INFO_YEAR: string = g_strdup ("N/A"); break; case BVW_INFO_VIDEO_CODEC: string = g_strdup ("N/A"); break; case BVW_INFO_AUDIO_CODEC: string = g_strdup ("N/A"); break; default: g_assert_not_reached (); }
add: switch (type) { case BVW_INFO_TITLE: string = g_hash_table_lookup (bvw->priv->metadata_hash, "title"); if (!string) string = g_strdup ("N/A"); break; case BVW_INFO_ARTIST: string = g_hash_table_lookup (bvw->priv->metadata_hash, "artist"); if (!string) string = g_strdup ("N/A"); break; case BVW_INFO_YEAR: string = g_hash_table_lookup (bvw->priv->metadata_hash, "year"); if (!string) string = g_strdup ("N/A"); break; case BVW_INFO_VIDEO_CODEC: string = g_hash_table_lookup (bvw->priv->metadata_hash, "video-codec"); if (!string) string = g_strdup ("N/A"); break; case BVW_INFO_AUDIO_CODEC: string = g_hash_table_lookup (bvw->priv->metadata_hash, "audio-codec"); if (!string) string = g_strdup ("N/A"); break; default: g_assert_not_reached (); }
context: bacon_video_widget_get_metadata_string (BaconVideoWidget *bvw, BaconVideoWidgetMetadataType type,		GValue *value){	const char *string = NULL;	g_value_init (value, G_TYPE_STRING);	if (bvw->priv->play == NULL)	{		g_value_set_string (value, "");		return;	}	switch (type)	{	case BVW_INFO_TITLE:		string = g_hash_table_lookup(bvw->priv->metadata_hash, "title");		break;	case BVW_INFO_ARTIST:		string = g_hash_table_lookup(bvw->priv->metadata_hash, "artist");		break;	case BVW_INFO_YEAR:		string = g_strdup ("N/A");		break;	case BVW_INFO_VIDEO_CODEC:		string = g_strdup ("N/A");		break;	case BVW_INFO_AUDIO_CODEC:		string = g_strdup ("N/A");		break;	default:		g_assert_not_reached ();	}	g_value_set_string (value, string);	return;}