check for NULL origin 27/32927/1
authorJaska Uimonen <jaska.uimonen@helsinki.fi>
Mon, 29 Dec 2014 09:22:56 +0000 (11:22 +0200)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Tue, 30 Dec 2014 11:13:46 +0000 (13:13 +0200)
It seems that there can be sink-input existing
without origin, so we have to check for the
origins existence.

Change-Id: I60a80c3fe06bab80e1a7934f2aa0ff9ff84209a9

murphy/fader.c

index 22c8bb4..c4b6139 100644 (file)
@@ -118,7 +118,10 @@ void pa_fader_apply_volume_limits(struct userdata *u, uint32_t stamp)
                 origin = pa_utils_get_stream_origin(u, sinp);
                 stream_node = pa_discover_find_node_by_ptr(u, origin);
 
-                if ((class = pa_utils_get_stream_class(sinp->proplist)) > 0) {
+                if (origin == NULL) {
+                    pa_log_debug("could not find origin for sink-input %d", sinp->index);
+                }
+                else if ((class = pa_utils_get_stream_class(sinp->proplist)) > 0) {
 
                     corked = stream_node ? !stream_node->rset.grant : false;
                     muted  = (sinp->muted  || pa_hashmap_get(sinp->volume_factor_items,