Skip to content

Commit

Permalink
audio/codec: allow PCMA/PCMU aliases
Browse files Browse the repository at this point in the history
instead of u-/a-law for convenience
  • Loading branch information
MartinPulec committed Aug 6, 2024
1 parent c531281 commit 544485b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/audio/codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#include "audio/codec.h"
#include "audio/utils.h"
#include "compat/strings.h" // strdupa
#include "compat/strings.h" // strdup, strcasecmp
#include "debug.h"
#include "lib_common.h"
#include "utils/macros.h"
Expand Down Expand Up @@ -389,6 +389,12 @@ get_audio_codec(const char *codec)
return it.first;
}
}
if (strcasecmp(codec, "PCMA") == 0) {
return AC_ALAW;
}
if (strcasecmp(codec, "PCMU") == 0) {
return AC_MULAW;
}
return AC_NONE;
}

Expand Down

0 comments on commit 544485b

Please sign in to comment.