Skip to content

Commit

Permalink
Merge remote-tracking branch 'mpg123/master' into master-with-github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mpg123 GitHub bot committed Dec 8, 2024
2 parents 2a71a9a + 4b29cac commit 932e556
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
------
- scripts/tag_lyrics.py: fix for python3 (thanks to cclauss,
github PR 16)
- libout123: Use strtok_r() to avoid conflicts multithreaded contexts
(both sides should avoid plain strtok()!).

1.32.9
------
Expand Down
7 changes: 4 additions & 3 deletions src/libout123/libout123.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
audio: audio output interface
copyright ?-2023 by the mpg123 project - free software under the terms of the LGPL 2.1
copyright ?-2024 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
*/
Expand Down Expand Up @@ -455,11 +455,12 @@ out123_open(out123_handle *ao, const char* driver, const char* device)
}

/* Now loop over the list of possible modules to find one that works. */
nextname = strtok(modnames, ",");
char *toksave = NULL;
nextname = strtok_r(modnames, ",", &toksave);
while(!ao->open && nextname)
{
char *curname = nextname;
nextname = strtok(NULL, ",");
nextname = strtok_r(NULL, ",", &toksave);
check_output_module(ao, curname, device, !nextname);
if(ao->open)
{
Expand Down
6 changes: 4 additions & 2 deletions src/libout123/modules/sndio.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ static int open_sndio(out123_handle *ao)
hdl = sio_open(ao->device /* NULL is fine */, SIO_PLAY, 0);
if (hdl == NULL)
{
error("Got nothing from sio_open(). ");
if(!AOQUIET)
error("Got nothing from sio_open(). ");
return -1;
}

Expand All @@ -152,7 +153,8 @@ static int open_sndio(out123_handle *ao)
hdl = sio_open(ao->device, SIO_PLAY, 0);
if(hdl == NULL)
{
error("Re-opening of device for channel guessing failed.");
if(!AOQUIET)
error("Re-opening of device for channel guessing failed.");
return -1;
}
par.pchan = guess_channels(hdl);
Expand Down

0 comments on commit 932e556

Please sign in to comment.