mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
FFmpeg: Support build with FFmpeg native opus. v5.0.131 (#3140)
This commit is contained in:
parent
372390f8d1
commit
a27ce1d50f
7 changed files with 46 additions and 24 deletions
|
@ -17,12 +17,12 @@ static const AVCodec* srs_find_decoder_by_id(SrsAudioCodecId id)
|
|||
} else if (id == SrsAudioCodecIdMP3) {
|
||||
return avcodec_find_decoder_by_name("mp3");
|
||||
} else if (id == SrsAudioCodecIdOpus) {
|
||||
const AVCodec* codec = avcodec_find_decoder_by_name("libopus");
|
||||
if (!codec) {
|
||||
// TODO: FIXME: Note that the audio might be corrupted, if use FFmpeg native opus.
|
||||
codec = avcodec_find_decoder_by_name("opus");
|
||||
}
|
||||
return codec;
|
||||
#ifdef SRS_FFMPEG_OPUS
|
||||
// TODO: FIXME: Note that the audio might be corrupted, see https://github.com/ossrs/srs/issues/3140
|
||||
return avcodec_find_decoder_by_name("opus");
|
||||
#else
|
||||
return avcodec_find_decoder_by_name("libopus");
|
||||
#endif
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -32,12 +32,12 @@ static const AVCodec* srs_find_encoder_by_id(SrsAudioCodecId id)
|
|||
if (id == SrsAudioCodecIdAAC) {
|
||||
return avcodec_find_encoder_by_name("aac");
|
||||
} else if (id == SrsAudioCodecIdOpus) {
|
||||
const AVCodec* codec = avcodec_find_encoder_by_name("libopus");
|
||||
if (!codec) {
|
||||
// TODO: FIXME: Note that the audio might be corrupted, if use FFmpeg native opus.
|
||||
codec = avcodec_find_encoder_by_name("opus");
|
||||
}
|
||||
return codec;
|
||||
#ifdef SRS_FFMPEG_OPUS
|
||||
// TODO: FIXME: Note that the audio might be corrupted, see https://github.com/ossrs/srs/issues/3140
|
||||
return avcodec_find_encoder_by_name("opus");
|
||||
#else
|
||||
return avcodec_find_encoder_by_name("libopus");
|
||||
#endif
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 130
|
||||
#define VERSION_REVISION 131
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue