mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	context: log more info on errors
This commit is contained in:
		
							parent
							
								
									2864e7ec75
								
							
						
					
					
						commit
						ad723e3793
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -27,13 +27,14 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <pulse/context.h>
 | 
					#include <pulse/context.h>
 | 
				
			||||||
#include <pulse/timeval.h>
 | 
					#include <pulse/timeval.h>
 | 
				
			||||||
 | 
					#include <pulse/error.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "internal.h"
 | 
					#include "internal.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_context_set_error(pa_context *c, int error) {
 | 
					int pa_context_set_error(pa_context *c, int error) {
 | 
				
			||||||
	pa_assert(error >= 0);
 | 
						pa_assert(error >= 0);
 | 
				
			||||||
	pa_assert(error < PA_ERR_MAX);
 | 
						pa_assert(error < PA_ERR_MAX);
 | 
				
			||||||
	pw_log_debug("context %p: error %d", c, error);
 | 
						pw_log_debug("context %p: error %d %s", c, error, pa_strerror(error));
 | 
				
			||||||
	if (c)
 | 
						if (c)
 | 
				
			||||||
		c->error = error;
 | 
							c->error = error;
 | 
				
			||||||
	return error;
 | 
						return error;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,6 +111,8 @@ int pa_context_set_error(pa_context *c, int error);
 | 
				
			||||||
#define PA_CHECK_VALIDITY(context, expression, error)			\
 | 
					#define PA_CHECK_VALIDITY(context, expression, error)			\
 | 
				
			||||||
do {									\
 | 
					do {									\
 | 
				
			||||||
	if (!(expression)) {						\
 | 
						if (!(expression)) {						\
 | 
				
			||||||
 | 
							pw_log_trace("'%s' failed at %s:%u %s()",		\
 | 
				
			||||||
 | 
								#expression, __FILE__, __LINE__, __func__);	\
 | 
				
			||||||
		return -pa_context_set_error((context), (error));	\
 | 
							return -pa_context_set_error((context), (error));	\
 | 
				
			||||||
	}								\
 | 
						}								\
 | 
				
			||||||
} while(false)
 | 
					} while(false)
 | 
				
			||||||
| 
						 | 
					@ -118,6 +120,8 @@ do {									\
 | 
				
			||||||
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value)	\
 | 
					#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value)	\
 | 
				
			||||||
do {									\
 | 
					do {									\
 | 
				
			||||||
	if (!(expression)) {						\
 | 
						if (!(expression)) {						\
 | 
				
			||||||
 | 
							pw_log_trace("'%s' failed at %s:%u %s()",		\
 | 
				
			||||||
 | 
								#expression, __FILE__, __LINE__, __func__);	\
 | 
				
			||||||
		pa_context_set_error((context), (error));		\
 | 
							pa_context_set_error((context), (error));		\
 | 
				
			||||||
		return value;						\
 | 
							return value;						\
 | 
				
			||||||
	}								\
 | 
						}								\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue