Use the auto-wrapping macro at the audio call site

This commit is contained in:
J. Nick Koston
2026-08-20 17:56:23 -05:00
parent 3d946596e9
commit cc5916ecca
+1 -3
View File
@@ -1,7 +1,6 @@
#include "audio.h"
#include "esphome/core/helpers.h"
#include "esphome/core/progmem.h"
#include <cstring>
@@ -87,8 +86,7 @@ AudioFileType detect_audio_file_type(const char *content_type, const char *url)
// Match "audio/ogg" with a codecs parameter containing "opus"
// Valid forms: audio/ogg;codecs=opus, audio/ogg; codecs="opus", etc.
// Plain "audio/ogg" without opus is not matched (almost always Ogg Vorbis)
if (strncasecmp(content_type, "audio/ogg", 9) == 0 &&
str_contains_ignore_case_p(content_type + 9, ESPHOME_PSTR("opus"))) {
if (strncasecmp(content_type, "audio/ogg", 9) == 0 && str_contains_ignore_case(content_type + 9, "opus")) {
return AudioFileType::OPUS;
}
#endif