mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
proper close order on error - release
This commit is contained in:
@@ -168,8 +168,8 @@ struct raop_ctx_s *raop_create(struct in_addr host, char *name,
|
||||
addr.sin_port = htons(ctx->port);
|
||||
#endif
|
||||
|
||||
if (bind(ctx->sock, (struct sockaddr *) &addr, sizeof(addr)) < 0 || listen(ctx->sock, 1)) {
|
||||
LOG_ERROR("Cannot bind or listen RTSP listener: %s", strerror(errno));
|
||||
LOG_ERROR("Cannot bind or listen RTSP listener: %s", strerror(errno));
|
||||
closesocket(ctx->sock);
|
||||
free(ctx);
|
||||
return NULL;
|
||||
|
||||
@@ -252,7 +252,7 @@ static void flac_open(u8_t sample_size, u8_t sample_rate, u8_t channels, u8_t en
|
||||
}
|
||||
|
||||
if ( f->container == 'o' ) {
|
||||
LOG_DEBUG("ogg/flac container - using init_ogg_stream");
|
||||
LOG_INFO("ogg/flac container - using init_ogg_stream");
|
||||
FLAC(f, stream_decoder_init_ogg_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL);
|
||||
} else {
|
||||
FLAC(f, stream_decoder_init_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL);
|
||||
|
||||
@@ -364,7 +364,7 @@ static decode_state helixaac_decode(void) {
|
||||
if (a->type == '2') {
|
||||
|
||||
// adts stream - seek for header
|
||||
long n = AACFindSyncWord(streambuf->readp, bytes_wrap);
|
||||
long n = HAAC(a, FindSyncWord, streambuf->readp, bytes_wrap);
|
||||
|
||||
LOG_DEBUG("Sync search in %d bytes %d", bytes_wrap, n);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user