]> code.delx.au - pulseaudio/commitdiff
pacat: Fail early if the media name cannot be set
authorMaarten Bosmans <mkbosmans@gmail.com>
Mon, 10 Oct 2011 07:27:17 +0000 (09:27 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 11 Oct 2011 17:18:25 +0000 (22:48 +0530)
Otherwise you get an "invalid argument" error from pa_stream_new later.

src/utils/pacat.c

index 3be1f6c8a8aebd339c97584e63a759ae4b001e8b..3c8e3c7c7021e03c0016c2d5f4b86bb264d52765 100644 (file)
@@ -1103,6 +1103,11 @@ int main(int argc, char *argv[]) {
         if ((t = filename) ||
             (t = pa_proplist_gets(proplist, PA_PROP_APPLICATION_NAME)))
             pa_proplist_sets(proplist, PA_PROP_MEDIA_NAME, t);
+
+        if (!pa_proplist_contains(proplist, PA_PROP_MEDIA_NAME)) {
+            pa_log(_("Failed to set media name."));
+            goto quit;
+        }
     }
 
     /* Set up a new main loop */