summaryrefslogtreecommitdiffstats
path: root/sound/squeezelite/patches/040-clear_dynlink_errors.patch
blob: 157157242d9b36c7c0bd3bc21a234a523a8d11d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- a/faad.c
+++ b/faad.c
@@ -593,6 +593,8 @@ static bool load_faad() {
 		return false;
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	a->NeAACDecGetCurrentConfiguration = dlsym(handle, "NeAACDecGetCurrentConfiguration");
 	a->NeAACDecSetConfiguration = dlsym(handle, "NeAACDecSetConfiguration");
 	a->NeAACDecOpen = dlsym(handle, "NeAACDecOpen");
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -590,6 +590,8 @@ static bool load_ff() {
 		return false;
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	sprintf(name, LIBAVFORMAT, LIBAVFORMAT_VERSION_MAJOR);
 	handle_format = dlopen(name, RTLD_NOW);
 	if (!handle_format) {
--- a/flac.c
+++ b/flac.c
@@ -241,6 +241,8 @@ static bool load_flac() {
 		return false;
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	f->FLAC__StreamDecoderErrorStatusString = dlsym(handle, "FLAC__StreamDecoderErrorStatusString");
 	f->FLAC__StreamDecoderStateString = dlsym(handle, "FLAC__StreamDecoderStateString");
 	f->FLAC__stream_decoder_new = dlsym(handle, "FLAC__stream_decoder_new");
--- a/ir.c
+++ b/ir.c
@@ -167,10 +167,10 @@ static void *ir_thread() {
 			UNLOCK_I;
 			wake_controller();
 		}
-		
+
 		free(code);
 	}
-	
+
 	return 0;
 }
 
@@ -184,6 +184,8 @@ static bool load_lirc() {
 		return false;
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	i->lirc_init = dlsym(handle, "lirc_init");
 	i->lirc_deinit = dlsym(handle, "lirc_deinit");
 	i->lirc_readconfig = dlsym(handle, "lirc_readconfig");
--- a/mad.c
+++ b/mad.c
@@ -364,7 +364,9 @@ static bool load_mad() {
 		LOG_INFO("dlerror: %s", dlerror());
 		return false;
 	}
-	
+
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	m->mad_stream_init = dlsym(handle, "mad_stream_init");
 	m->mad_frame_init = dlsym(handle, "mad_frame_init");
 	m->mad_synth_init = dlsym(handle, "mad_synth_init");
--- a/mpg.c
+++ b/mpg.c
@@ -221,7 +221,9 @@ static bool load_mpg() {
 		LOG_INFO("dlerror: %s", dlerror());
 		return false;
 	}
-	
+
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	m->mpg123_init = dlsym(handle, "mpg123_init");
 	m->mpg123_feature = dlsym(handle, "mpg123_feature");
 	m->mpg123_rates = dlsym(handle, "mpg123_rates");
--- a/resample.c
+++ b/resample.c
@@ -250,6 +250,8 @@ static bool load_soxr(void) {
 		return false;
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	r->soxr_io_spec = dlsym(handle, "soxr_io_spec");
 	r->soxr_quality_spec = dlsym(handle, "soxr_quality_spec");
 	r->soxr_create = dlsym(handle, "soxr_create");
--- a/vorbis.c
+++ b/vorbis.c
@@ -286,6 +286,8 @@ static bool load_vorbis() {
 		}
 	}
 
+	err = dlerror();	// Reset previous dynamic linking error string (if there was)
+
 	v->ov_read = tremor ? NULL : dlsym(handle, "ov_read");
 	v->ov_read_tremor = tremor ? dlsym(handle, "ov_read") : NULL;
 	v->ov_info = dlsym(handle, "ov_info");