Codebase list squeezelite / 0f9850d
1.0rc3 - ensure silencebuf is set to silence - avoid sending STMo on track jumps - send elapsed time of 0 as soon as track changes (to make UI update to 0 faster) Adrian Smith 11 years ago
6 changed file(s) with 34 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
0 # OSX build - adjust -I to point to header files for codecs and portaudio
1 CFLAGS = -arch x86_64 -arch i386 -Wall -fPIC -O2 -I./include
2 LDFLAGS = -arch x86_64 -arch i386 -lpthread libportaudio.a -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
3
4 EXECUTABLE ?= squeezelite-osx
5
6 include Makefile
137137 }
138138 running = false;
139139 UNLOCK_D;
140 #if LINUX || OSX
141 pthread_join(thread, NULL);
142 #endif
140143 mutex_destroy(decode.mutex);
141144 }
142145
13071307 output.buffer_time = buffer_time;
13081308 output.period_count = period_count;
13091309
1310 memset(silencebuf, 0, sizeof(silencebuf));
1311
13101312 if (alsa_sample_fmt) {
13111313 if (!strcmp(alsa_sample_fmt, "32")) alsa.format = SND_PCM_FORMAT_S32_LE;
13121314 if (!strcmp(alsa_sample_fmt, "24")) alsa.format = SND_PCM_FORMAT_S24_LE;
13881390 buf_flush(outputbuf);
13891391 LOCK;
13901392 output.fade = FADE_INACTIVE;
1393 output.state = OUTPUT_STOPPED;
1394 output.frames_played = 0;
13911395 UNLOCK;
13921396 }
13931397
14041408
14051409 #if ALSA
14061410 UNLOCK;
1407 pthread_join(thread,NULL);
1411 pthread_join(thread, NULL);
14081412 if (alsa.write_buf) free(alsa.write_buf);
14091413 #endif
14101414
120120 u32_t now = gettime_ms();
121121 u32_t ms_played;
122122
123 if (status.current_sample_rate) {
123 if (status.current_sample_rate && status.frames_played && status.frames_played > status.device_frames) {
124124 ms_played = (u32_t)(((u64_t)(status.frames_played - status.device_frames) * (u64_t)1000) / (u64_t)status.current_sample_rate);
125125 if (now > status.updated) ms_played += (now - status.updated);
126126 } else {
222222 sendSTAT("STMt", strm->replay_gain); // STMt replay_gain is no longer used to track latency, but support it
223223 break;
224224 case 'q':
225 stream_disconnect();
225 output_flush();
226 status.frames_played = 0;
227 if (stream_disconnect()) {
228 sendSTAT("STMf", 0);
229 }
226230 buf_flush(streambuf);
227 output_flush();
228231 break;
229232 case 'f':
230 stream_disconnect();
233 output_flush();
234 status.frames_played = 0;
235 if (stream_disconnect()) {
236 sendSTAT("STMf", 0);
237 }
231238 buf_flush(streambuf);
232 output_flush();
233239 break;
234240 case 'p':
235241 {
1717 *
1818 */
1919
20 #define VERSION "v1.0rc2"
20 #define VERSION "v1.0rc3"
2121
2222 // build detection
2323 #if defined(linux)
346346 void stream_close(void);
347347 void stream_file(const char *header, size_t header_len, unsigned threshold);
348348 void stream_sock(u32_t ip, u16_t port, const char *header, size_t header_len, unsigned threshold, bool cont_wait);
349 void stream_disconnect(void);
349 bool stream_disconnect(void);
350350
351351 // decode.c
352352 typedef enum { DECODE_STOPPED = 0, DECODE_RUNNING, DECODE_COMPLETE, DECODE_ERROR } decode_state;
297297 running = false;
298298 UNLOCK;
299299 #if LINUX || OSX
300 pthread_join(thread,NULL);
300 pthread_join(thread, NULL);
301301 #endif
302302 free(stream.header);
303303 buf_destroy(streambuf);
386386 UNLOCK;
387387 }
388388
389 void stream_disconnect(void) {
389 bool stream_disconnect(void) {
390 bool disc = false;
390391 LOCK;
391392 if (fd != -1) {
392393 closesocket(fd);
393394 fd = -1;
395 disc = true;
394396 }
395397 stream.state = STOPPED;
396398 UNLOCK;
397 }
399 return disc;
400 }