1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

Opus: Add TODO because the audio might be corrupted, if use FFmpeg native opus.

This commit is contained in:
winlin 2022-08-09 10:02:36 +08:00
parent 46cb4ced93
commit 25c004e947
2 changed files with 6 additions and 0 deletions

View file

@ -709,6 +709,10 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then
if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cpu=$SRS_CROSS_BUILD_CPU"; fi if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cpu=$SRS_CROSS_BUILD_CPU"; fi
FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cross-prefix=$SRS_CROSS_BUILD_PREFIX" FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cross-prefix=$SRS_CROSS_BUILD_PREFIX"
FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cc=${SRS_TOOL_CC} --cxx=${SRS_TOOL_CXX} --ar=${SRS_TOOL_AR} --ld=${SRS_TOOL_LD}" FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cc=${SRS_TOOL_CC} --cxx=${SRS_TOOL_CXX} --ar=${SRS_TOOL_AR} --ld=${SRS_TOOL_LD}"
fi
# For cross-build.
if [[ $SRS_CROSS_BUILD == YES ]]; then
# Note that the audio might be corrupted, if use FFmpeg native opus.
FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=opus --enable-encoder=opus" FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=opus --enable-encoder=opus"
else else
FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=libopus --enable-encoder=libopus --enable-libopus" FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-decoder=libopus --enable-encoder=libopus --enable-libopus"

View file

@ -17,6 +17,7 @@ static const AVCodec* srs_find_decoder_by_id(SrsAudioCodecId id)
} else if (id == SrsAudioCodecIdOpus) { } else if (id == SrsAudioCodecIdOpus) {
const AVCodec* codec = avcodec_find_decoder_by_name("libopus"); const AVCodec* codec = avcodec_find_decoder_by_name("libopus");
if (!codec) { if (!codec) {
// TODO: FIXME: Note that the audio might be corrupted, if use FFmpeg native opus.
codec = avcodec_find_decoder_by_name("opus"); codec = avcodec_find_decoder_by_name("opus");
} }
return codec; return codec;
@ -31,6 +32,7 @@ static const AVCodec* srs_find_encoder_by_id(SrsAudioCodecId id)
} else if (id == SrsAudioCodecIdOpus) { } else if (id == SrsAudioCodecIdOpus) {
const AVCodec* codec = avcodec_find_encoder_by_name("libopus"); const AVCodec* codec = avcodec_find_encoder_by_name("libopus");
if (!codec) { if (!codec) {
// TODO: FIXME: Note that the audio might be corrupted, if use FFmpeg native opus.
codec = avcodec_find_encoder_by_name("opus"); codec = avcodec_find_encoder_by_name("opus");
} }
return codec; return codec;