*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
pa_proplist *props = pa_proplist_new ();
if (likely(props != NULL))
{
- pa_proplist_sets (props, PA_PROP_APPLICATION_NAME, ua);
- pa_proplist_sets (props, PA_PROP_APPLICATION_ID, "org.VideoLAN.VLC");
- pa_proplist_sets (props, PA_PROP_APPLICATION_VERSION, PACKAGE_VERSION);
- pa_proplist_sets (props, PA_PROP_APPLICATION_ICON_NAME, PACKAGE_NAME);
+ char *str;
+
+ if (ua != NULL)
+ pa_proplist_sets (props, PA_PROP_APPLICATION_NAME, ua);
+
+ str = var_InheritString (obj, "app-id");
+ if (str != NULL)
+ {
+ pa_proplist_sets (props, PA_PROP_APPLICATION_ID, str);
+ free (str);
+ }
+ str = var_InheritString (obj, "app-version");
+ if (str != NULL)
+ {
+ pa_proplist_sets (props, PA_PROP_APPLICATION_VERSION, str);
+ free (str);
+ }
+ str = var_InheritString (obj, "app-icon-name");
+ if (str != NULL)
+ {
+ pa_proplist_sets (props, PA_PROP_APPLICATION_ICON_NAME, str);
+ free (str);
+ }
//pa_proplist_sets (props, PA_PROP_APPLICATION_LANGUAGE, _("C"));
pa_proplist_sets (props, PA_PROP_APPLICATION_LANGUAGE,
setlocale (LC_MESSAGES, NULL));
//pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_BINARY,
// PACKAGE_NAME);
- char buf[sysconf (_SC_GETPW_R_SIZE_MAX)];
- struct passwd pwbuf, *pw;
+ for (size_t max = sysconf (_SC_GETPW_R_SIZE_MAX), len = max % 1024 + 1024;
+ len < max; len += 1024)
+ {
+ struct passwd pwbuf, *pw;
+ char buf[len];
+
+ if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0)
+ {
+ if (pw != NULL)
+ pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
+ pw->pw_name);
+ break;
+ }
+ }
- if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0
- && pw != NULL)
- pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
- pw->pw_name);
+ for (size_t max = sysconf (_SC_HOST_NAME_MAX), len = max % 1024 + 1024;
+ len < max; len += 1024)
+ {
+ char hostname[len];
- char hostname[sysconf (_SC_HOST_NAME_MAX)];
- if (gethostname (hostname, sizeof (hostname)) == 0)
- pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_HOST,
- hostname);
+ if (gethostname (hostname, sizeof (hostname)) == 0)
+ {
+ pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_HOST,
+ hostname);
+ break;
+ }
+ }
const char *session = getenv ("XDG_SESSION_COOKIE");
if (session != NULL)