Skip to content

Commit

Permalink
Fix conflict with unistd.h
Browse files Browse the repository at this point in the history
Rename pause() to pause_play().

This commit fixes the following build error:

../audio/out/ao_pulse.c:539:13: error: conflicting types for ‘pause’; have ‘void(struct ao *)’
  539 | static void pause(struct ao *ao)
      |             ^~~~~
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/sys/param.h:28,
                 from /usr/include/pulse/sample.h:26,
                 from /usr/include/pulse/def.h:28,
                 from /usr/include/pulse/direction.h:23,
                 from /usr/include/pulse/pulseaudio.h:24,
                 from ../audio/out/ao_pulse.c:28:
/usr/include/unistd.h:489:12: note: previous declaration of ‘pause’ with type ‘int(void)’
  489 | extern int pause (void);
      |            ^~~~~
  • Loading branch information
mans0n committed Mar 8, 2022
1 parent 17c21ac commit 9544cb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mpv/audio/out/ao_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void reset(struct ao *ao)
}

// stop playing, keep buffers (for pause)
static void pause(struct ao *ao)
static void pause_play(struct ao *ao)
{
struct priv *priv = ao->priv;

Expand Down Expand Up @@ -227,7 +227,7 @@ const struct ao_driver audio_out_null = {
.get_space = get_space,
.play = play,
.get_delay = get_delay,
.pause = pause,
.pause = pause_play,
.resume = resume,
.drain = wait_drain,
.priv_size = sizeof(struct priv),
Expand Down
4 changes: 2 additions & 2 deletions src/mpv/audio/out/ao_pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static void reset(struct ao *ao)
}

// Pause the audio stream by corking it on the server
static void pause(struct ao *ao)
static void pause_play(struct ao *ao)
{
cork(ao, true);
}
Expand Down Expand Up @@ -810,7 +810,7 @@ const struct ao_driver audio_out_pulse = {
.get_space = get_space,
.play = play,
.get_delay = get_delay,
.pause = pause,
.pause = pause_play,
.resume = resume,
.drain = drain,
.wait = wait_audio,
Expand Down

0 comments on commit 9544cb0

Please sign in to comment.