mirror of
https://github.com/esphome/esphome.git
synced 2026-08-29 01:03:29 +00:00
Use the auto-wrapping macro at the audio call site
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user