[vlc-commits] [Git][videolan/vlc][master] service discovery/radio: ignore null optional CSV values
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Sep 11 06:32:45 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
4e6888f9 by Serhii Bykov at 2026-09-11T08:22:26+02:00
service discovery/radio: ignore null optional CSV values
- - - - -
1 changed file:
- modules/services_discovery/radio.c
Changes:
=====================================
modules/services_discovery/radio.c
=====================================
@@ -391,9 +391,17 @@ static void Close(vlc_object_t *p_this)
free(p_sys);
}
+/* Radio Browser's CSV API serializes missing optional values as "null". */
+static bool FieldHasValue(csv_parser *parser, int index)
+{
+ return index >= 0 && parser->fields[index] != NULL &&
+ parser->fields[index][0] != '\0' &&
+ strcmp(parser->fields[index], "null") != 0;
+}
+
static void SetMetaFromField(input_item_t *item, csv_parser *parser, int index, vlc_meta_type_t type)
{
- if (index < 0 || strlen(parser->fields[index]) == 0)
+ if (!FieldHasValue(parser, index))
return;
input_item_SetMeta(item, type, parser->fields[index]);
@@ -401,7 +409,7 @@ static void SetMetaFromField(input_item_t *item, csv_parser *parser, int index,
static void SetMetaExtraFromField(input_item_t *item, csv_parser *parser, int index, const char *name)
{
- if (index < 0 || strlen(parser->fields[index]) == 0)
+ if (!FieldHasValue(parser, index))
return;
input_item_SetMetaExtra(item, name, parser->fields[index]);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4e6888f9ab90034985e96ea9ab671aaf84c7a633
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4e6888f9ab90034985e96ea9ab671aaf84c7a633
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list