Skip to content

Commit a3c0085

Browse files
committed
Sound: tidy
1 parent c8f28e4 commit a3c0085

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/detection/media/media_linux.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "fastfetch.h"
22
#include "detection/media/media.h"
3-
#include "common/thread.h"
43
#include "util/stringUtils.h"
54

65
#include <string.h>
@@ -11,7 +10,6 @@
1110
#ifdef FF_HAVE_DBUS
1211
#include "common/dbus.h"
1312
#include "common/library.h"
14-
#include "common/parsing.h"
1513

1614
static bool getBusProperties(FFDBusData* data, const char* busName, FFMediaResult* result)
1715
{

src/detection/sound/sound_bsd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const char* ffDetectSound(FFlist* devices)
1919
uint32_t devmask = 0;
2020
if (ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devmask) < 0)
2121
continue;
22-
if (!((1 << SOUND_MIXER_VOLUME) & devmask))
22+
if (!(devmask & SOUND_MASK_VOLUME))
2323
continue;
2424

2525
uint32_t mutemask = 0;
@@ -31,13 +31,13 @@ const char* ffDetectSound(FFlist* devices)
3131
continue;
3232

3333
uint32_t volume;
34-
if (ioctl(fd, MIXER_READ(SOUND_MIXER_VOLUME), &volume) < 0)
34+
if (ioctl(fd, SOUND_MIXER_READ_VOLUME, &volume) < 0)
3535
continue;
3636

3737
FFSoundDevice* device = ffListAdd(devices);
3838
ffStrbufInitS(&device->identifier, path);
3939
ffStrbufInitF(&device->name, "%s %s", ci.longname, ci.hw_info);
40-
device->volume = (1 << SOUND_MIXER_VOLUME) & mutemask
40+
device->volume = mutemask & SOUND_MASK_VOLUME
4141
? 0
4242
: ((uint8_t) volume /*left*/ + (uint8_t) (volume >> 8) /*right*/) / 2;
4343
device->active = true;

0 commit comments

Comments
 (0)