Skip to content

Commit

Permalink
1.8.3-NR1
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Jan 27, 2024
1 parent f907d64 commit 8125fc5
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 56 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.8.3 (NR)
- (aircast) stream type is LIVE and duration is not part of metadata

1.8.2
- UpnpResolveURL needs one extra byte if RelURL parameters does not start with a '/'
- use setlocale() so that atof does not fail on '.'

1.8.1
- handle double resend from iOS and silence after flush

Expand Down
38 changes: 21 additions & 17 deletions aircast/src/aircast.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#ifdef _WIN32
#include <process.h>
#endif
Expand Down Expand Up @@ -95,26 +96,26 @@ static char usage[] =
VERSION "\n"
"See -t for license terms\n"
"Usage: [options]\n"
" -b <ip|iface>\t\tnetwork address or interface to bind to\n"
" -a <port>[:<count>]\tset inbound port and range for RTP and HTTP\n"
" -b <ip|iface>network address or interface to bind to\n"
" -a <port>[:<count>] set inbound port and range for RTP and HTTP\n"
" -c <mp3[:<rate>]|aac[:<rate>]|flac[:0..9]|wav>\taudio format send to player\n"
" -v <0..1>\t\t group MediaVolume factor\n"
" -x <config file>\tread config from file (default is ./config.xml)\n"
" -i <config file>\tdiscover players, save <config file> and exit\n"
" -I \t\t\tauto save config at every network scan\n"
" -N <format>\t\ttransform device name using C format (%s=name)\n"
" -l <[rtp][:http][:f]>\tRTP and HTTP latency (ms), ':f' forces silence fill\n"
" -r \t\t\tlet timing reference drift (no click)\n"
" -f <logfile>\t\tWrite debug to logfile\n"
" -p <pid file>\t\twrite PID in file\n"
" -d <log>=<level>\tSet logging level, logs: all|raop|main|util|cast, level: error|warn|info|debug|sdebug\n"
" -v <0..1> group MediaVolume factor\n"
" -x <config file> read config from file (default is ./config.xml)\n"
" -i <config file> discover players, save <config file> and exit\n"
" -I auto save config at every network scan\n"
" -N <format> transform device name using C format (%s=name)\n"
" -l <[rtp][:http][:f]> RTP and HTTP latency (ms), ':f' forces silence fill\n"
" -r let timing reference drift (no click)\n"
" -f <logfile> write debug to logfile\n"
" -p <pid file> write PID in file\n"
" -d <log>=<level> set logging level, logs: all|raop|main|util|cast, level: error|warn|info|debug|sdebug\n"
#if LINUX || FREEBSD
" -z \t\t\tDaemonize\n"
" -z daemonize\n"
#endif
" -Z \t\t\tNOT interactive\n"
" -k \t\t\tImmediate exit on SIGQUIT and SIGTERM\n"
" -t \t\t\tLicense terms\n"
" --noflush\t\tignore flush command (wait for teardown to stop)\n"
" -Z NOT interactive\n"
" -k immediate exit on SIGQUIT and SIGTERM\n"
" -t license terms\n"
" --noflush ignore flush command (wait for teardown to stop)\n"
"\n"
"Build options:"
#if LINUX
Expand Down Expand Up @@ -921,6 +922,9 @@ int main(int argc, char *argv[]) {
signal(SIGPIPE, SIG_IGN);
#endif

// otherwise some atof/strtod fail with '.'
setlocale(LC_NUMERIC, "C");

netsock_init();

// first try to find a config file on the command line
Expand Down
2 changes: 1 addition & 1 deletion aircast/src/aircast.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "raop_server.h"
#include "cast_util.h"

#define VERSION "v1.8.1"" ("__DATE__" @ "__TIME__")"
#define VERSION "v1.8.3NR"" ("__DATE__" @ "__TIME__")"

/*----------------------------------------------------------------------------*/
/* typedefs */
Expand Down
18 changes: 9 additions & 9 deletions aircast/src/cast_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ static json_t* BuildMetaData(struct metadata_s* MetaData) {
json_decref(artwork);
}

if (MetaData->duration) {
json_t* duration = json_pack("{sf}", "duration", (double)MetaData->duration / 1000);
json_object_update(json, duration);
json_decref(duration);
}

return json_pack("{so}", "metadata", json);
}

Expand Down Expand Up @@ -117,8 +111,14 @@ bool CastLoad(struct sCastCtx *Ctx, char *URI, char *ContentType, const char *Na
return false;
}

msg = json_pack("{ss,ss,ss}", "contentId", URI, "streamType", "BUFFERED",
"contentType", ContentType);
msg = json_pack("{ss,ss,ss}", "contentId", URI, "streamType", !MetaData->duration ? "LIVE" : "BUFFERED",
"contentType", ContentType);

if (MetaData->duration) {
json_t* duration = json_pack("{sf}", "duration", (double)MetaData->duration / 1000);
json_object_update(msg, duration);
json_decref(duration);
}

if (StartTime) customData = json_pack("{s{sssI}}", "customData", "deviceName", Name, "startTime", StartTime);
else customData = json_pack("{s{ss}}", "customData", "deviceName", Name);
Expand Down Expand Up @@ -219,7 +219,7 @@ void CastPlay(struct sCastCtx* Ctx, struct metadata_s* MetaData) {
pthread_mutex_lock(&Ctx->Mutex);

json_t* customData;
if (MetaData && MetaData->live_duration) customData = json_pack("{si}", "live_duration", MetaData->live_duration);
if (MetaData && MetaData->live_duration != -1) customData = json_pack("{si}", "liveDuration", MetaData->live_duration);
else customData = json_object();

json_t* item = BuildMetaData(MetaData);
Expand Down
49 changes: 26 additions & 23 deletions airupnp/src/airupnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <stdio.h>
#include <string.h>
#include <locale.h>
#ifdef _WIN32
#include <process.h>
#endif
Expand Down Expand Up @@ -137,31 +138,30 @@ static char usage[] =
VERSION "\n"
"See -t for license terms\n"
"Usage: [options]\n"
" -b <ip|iface>[:<port>]\tnetwork interface or interface and UPnP port to use\n"
" -a <port>[:<count>]\tset inbound port and range for RTP and HTTP\n"
" -c <mp3[:<rate>]|flac[:0..9]|wav|pcm>\taudio format send to player\n"
" -g <-3|-1|0>\t\tHTTP content-length mode (-3:chunked, -1:none, 0:fixed)\n"
" -u <version>\tset the maximum UPnP version for search (default 1)\n"
" -x <config file>\tread config from file (default is ./config.xml)\n"
" -i <config file>\tdiscover players, save <config file> and exit\n"
" -I \t\t\tauto save config at every network scan\n"
" -l <[rtp][:http][:f]>\tRTP and HTTP latency (ms), ':f' forces silence fill\n"
" -r \t\t\tlet timing reference drift (no click)\n"
" -f <logfile>\t\twrite debug to logfile\n"
" -p <pid file>\t\twrite PID in file\n"
" -N <format>\t\ttransform device name using C format (%s=name)\n"
" -m <n1,n2...>\t\texclude devices whose model include tokens\n"
" -n <m1,m2,...>\texclude devices whose name includes tokens\n"
" -o <m1,m2,...>\tinclude only listed models; overrides -m and -n (use <NULL> if player don't return a model)\n"
" -d <log>=<level>\tSet logging level, logs: all|raop|main|util|upnp, level: error|warn|info|debug|sdebug\n"

" -b <ip|iface>[:<port>] network interface or interface and UPnP port to use\n"
" -a <port>[:<count>] set inbound port and range for RTP and HTTP\n"
" -c <mp3[:<rate>]|flac[:0..9]|wav|pcm> audio format send to player\n"
" -g <-3|-1|0> HTTP content-length mode (-3:chunked, -1:none, 0:fixed)\n"
" -u <version> set the maximum UPnP version for search (default 1)\n"
" -x <config file> read config from file (default is ./config.xml)\n"
" -i <config file> discover players, save <config file> and exit\n"
" -I auto save config at every network scan\n"
" -l <[rtp][:http][:f]> RTP and HTTP latency (ms), ':f' forces silence fill\n"
" -r let timing reference drift (no click)\n"
" -f <logfile> write debug to logfile\n"
" -p <pid file> write PID in file\n"
" -N <format> transform device name using C format (%s=name)\n"
" -m <n1,n2...> exclude devices whose model include tokens\n"
" -n <m1,m2,...> exclude devices whose name includes tokens\n"
" -o <m1,m2,...> include only listed models; overrides -m and -n (use <NULL> if player don't return a model)\n"
" -d <log>=<level> set logging level, logs: all|raop|main|util|upnp, level: error|warn|info|debug|sdebug\n"
#if LINUX || FREEBSD
" -z \t\t\tDaemonize\n"
" -z daemonize\n"
#endif
" -Z \t\t\tNOT interactive\n"
" -k \t\t\tImmediate exit on SIGQUIT and SIGTERM\n"
" -t \t\t\tLicense terms\n"
" --noflush\t\tignore flush command (wait for teardown to stop)\n"
" -Z NOT interactive\n"
" -k immediate exit on SIGQUIT and SIGTERM\n"
" -t license terms\n"
" --noflush ignore flush command (wait for teardown to stop)\n"
"\n"
"Build options:"
#if LINUX
Expand Down Expand Up @@ -1356,6 +1356,9 @@ int main(int argc, char *argv[]) {
signal(SIGPIPE, SIG_IGN);
#endif

// otherwise some atof/strtod fail with '.'
setlocale(LC_NUMERIC, "C");

netsock_init();

// first try to find a config file on the command line
Expand Down
2 changes: 1 addition & 1 deletion airupnp/src/airupnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "cross_util.h"
#include "metadata.h"

#define VERSION "v1.8.1"" ("__DATE__" @ "__TIME__")"
#define VERSION "v1.8.3NR"" ("__DATE__" @ "__TIME__")"

/*----------------------------------------------------------------------------*/
/* typedefs */
Expand Down
6 changes: 3 additions & 3 deletions airupnp/src/mr_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ int XMLFindAndParseService(IXML_Document* DescDoc, const char* location,
relcontrolURL = XMLGetFirstElementItem(service, "controlURL");
releventURL = XMLGetFirstElementItem(service, "eventSubURL");
NFREE(*controlURL);
*controlURL = (char*)malloc(strlen(base) + strlen(relcontrolURL) + 1);
*controlURL = (char*)malloc(strlen(base) + strlen(relcontrolURL) + 1 + 10);
if (*controlURL) {
ret = UpnpResolveURL(base, relcontrolURL, *controlURL);
if (ret != UPNP_E_SUCCESS) LOG_ERROR("Error generating controlURL from %s + %s", base, relcontrolURL);
}
NFREE(*eventURL);
*eventURL = (char*)malloc(strlen(base) + strlen(releventURL) + 1);
*eventURL = (char*)malloc(strlen(base) + strlen(releventURL) + 1 + 10);
if (*eventURL) {
ret = UpnpResolveURL(base, releventURL, *eventURL);
if (ret != UPNP_E_SUCCESS) LOG_ERROR("Error generating eventURL from %s + %s", base, releventURL);
Expand All @@ -330,7 +330,7 @@ int XMLFindAndParseService(IXML_Document* DescDoc, const char* location,

/*----------------------------------------------------------------------------*/
bool XMLFindAction(const char* base, char* service, char* action) {
char* url = malloc(strlen(base) + strlen(service) + 1);
char* url = malloc(strlen(base) + strlen(service) + 1 + 10);
IXML_Document* AVTDoc = NULL;
bool res = false;

Expand Down
2 changes: 1 addition & 1 deletion common/libcodecs
Submodule libcodecs updated 92 files
+1 −1 flac
+ targets/freebsd/x86_64/libalac.a
+ targets/freebsd/x86_64/libcodecs.a
+ targets/freebsd/x86_64/libfaac.a
+ targets/freebsd/x86_64/libfaad.a
+ targets/freebsd/x86_64/libflac.a
+ targets/freebsd/x86_64/libmad.a
+ targets/freebsd/x86_64/libogg.a
+ targets/freebsd/x86_64/libopus.a
+ targets/freebsd/x86_64/libopusenc.a
+ targets/freebsd/x86_64/libopusfile.a
+ targets/freebsd/x86_64/libopusurl.a
+ targets/freebsd/x86_64/libshine.a
+ targets/freebsd/x86_64/libsoxr.a
+ targets/freebsd/x86_64/libutf8.a
+ targets/freebsd/x86_64/libvorbis.a
+ targets/freebsd/x86_64/libvorbisenc.a
+ targets/freebsd/x86_64/libvorbisfile.a
+ targets/linux/aarch64/libcodecs.a
+ targets/linux/aarch64/libflac.a
+ targets/linux/arm/libcodecs.a
+ targets/linux/arm/libflac.a
+ targets/linux/armv5/libcodecs.a
+ targets/linux/armv5/libflac.a
+ targets/linux/armv6/libcodecs.a
+ targets/linux/armv6/libflac.a
+ targets/linux/mips/libcodecs.a
+ targets/linux/mips/libflac.a
+ targets/linux/mipsel/libcodecs.a
+ targets/linux/mipsel/libflac.a
+ targets/linux/powerpc/libcodecs.a
+ targets/linux/powerpc/libflac.a
+ targets/linux/sparc64/libcodecs.a
+ targets/linux/sparc64/libflac.a
+ targets/linux/x86/libcodecs.a
+ targets/linux/x86/libflac.a
+ targets/linux/x86_64/libcodecs.a
+ targets/linux/x86_64/libflac.a
+ targets/macos/arm64/libalac.a
+ targets/macos/arm64/libcodecs.a
+ targets/macos/arm64/libfaac.a
+ targets/macos/arm64/libfaad.a
+ targets/macos/arm64/libflac.a
+ targets/macos/arm64/libmad.a
+ targets/macos/arm64/libogg.a
+ targets/macos/arm64/libopus.a
+ targets/macos/arm64/libopusenc.a
+ targets/macos/arm64/libopusfile.a
+ targets/macos/arm64/libopusurl.a
+ targets/macos/arm64/libshine.a
+ targets/macos/arm64/libutf8.a
+ targets/macos/arm64/libvorbis.a
+ targets/macos/arm64/libvorbisenc.a
+ targets/macos/arm64/libvorbisfile.a
+ targets/macos/x86_64/libalac.a
+ targets/macos/x86_64/libcodecs.a
+ targets/macos/x86_64/libfaac.a
+ targets/macos/x86_64/libfaad.a
+ targets/macos/x86_64/libflac.a
+ targets/macos/x86_64/libmad.a
+ targets/macos/x86_64/libogg.a
+ targets/macos/x86_64/libopus.a
+ targets/macos/x86_64/libopusenc.a
+ targets/macos/x86_64/libopusfile.a
+ targets/macos/x86_64/libopusurl.a
+ targets/macos/x86_64/libshine.a
+ targets/macos/x86_64/libsoxr.a
+ targets/macos/x86_64/libutf8.a
+ targets/macos/x86_64/libvorbis.a
+ targets/macos/x86_64/libvorbisenc.a
+ targets/macos/x86_64/libvorbisfile.a
+ targets/solaris/x86_64/libalac.a
+ targets/solaris/x86_64/libcodecs.a
+ targets/solaris/x86_64/libfaac.a
+ targets/solaris/x86_64/libfaad.a
+ targets/solaris/x86_64/libflac.a
+ targets/solaris/x86_64/libmad.a
+ targets/solaris/x86_64/libogg.a
+ targets/solaris/x86_64/libopus.a
+ targets/solaris/x86_64/libopusenc.a
+ targets/solaris/x86_64/libopusfile.a
+ targets/solaris/x86_64/libopusurl.a
+ targets/solaris/x86_64/libshine.a
+ targets/solaris/x86_64/libsoxr.a
+ targets/solaris/x86_64/libutf8.a
+ targets/solaris/x86_64/libvorbis.a
+ targets/solaris/x86_64/libvorbisenc.a
+ targets/solaris/x86_64/libvorbisfile.a
+ targets/win32/x86/FLAC.lib
+ targets/win32/x86/faac.lib
+ targets/win32/x86/libaddons.lib
+ targets/win32/x86/libcodecs.lib

0 comments on commit 8125fc5

Please sign in to comment.