[PATCH 2/2] pacat: Fail early if the media name cannot be set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise you get an "invalid argument" error from pa_stream_new later.
---
 src/utils/pacat.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 3be1f6c..3c8e3c7 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -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 */
-- 
1.7.4.1



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux