Skip to content

Commit 4672b78

Browse files
committed
Sound: don't show 255 in custom format
Fix #1750
1 parent 36b0fdb commit 4672b78

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/modules/sound/sound.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ static void printDevice(FFSoundOptions* options, const FFSoundDevice* device, ui
4646
else
4747
{
4848
FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate();
49-
if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT)
50-
ffPercentAppendNum(&percentageNum, device->volume, options->percent, false, &options->moduleArgs);
5149
FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate();
52-
if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT)
53-
ffPercentAppendBar(&percentageBar, device->volume, options->percent, &options->moduleArgs);
50+
if(device->volume != FF_SOUND_VOLUME_UNKNOWN)
51+
{
52+
if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT)
53+
ffPercentAppendNum(&percentageNum, device->volume, options->percent, false, &options->moduleArgs);
54+
if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT)
55+
ffPercentAppendBar(&percentageBar, device->volume, options->percent, &options->moduleArgs);
56+
}
5457

5558
FF_PRINT_FORMAT_CHECKED(FF_SOUND_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, ((FFformatarg[]) {
5659
FF_FORMAT_ARG(device->main, "is-main"),

0 commit comments

Comments
 (0)