diff --git a/ext-codec/G711.cpp b/ext-codec/G711.cpp index 0ea6c762..a456f8bc 100644 --- a/ext-codec/G711.cpp +++ b/ext-codec/G711.cpp @@ -38,7 +38,7 @@ CodecId getCodecU() { } Track::Ptr getTrackByCodecId_l(CodecId codec, int sample_rate, int channels, int sample_bit) { - return (sample_rate && channels && sample_bit) ? std::make_shared(codec, sample_rate, channels, sample_bit) : nullptr; + return std::make_shared(codec, sample_rate, 1, 16); } Track::Ptr getTrackByCodecIdA(int sample_rate, int channels, int sample_bit) { diff --git a/src/Extension/Factory.h b/src/Extension/Factory.h index 7f7bdceb..c97a77ec 100644 --- a/src/Extension/Factory.h +++ b/src/Extension/Factory.h @@ -65,7 +65,7 @@ public: * [AUTO-TRANSLATED:397b982e] */ - static Track::Ptr getTrackByCodecId(CodecId codecId, int sample_rate = 0, int channels = 0, int sample_bit = 0); + static Track::Ptr getTrackByCodecId(CodecId codecId, int sample_rate = 0, int channels = 1, int sample_bit = 16); // //////////////////////////////rtsp相关////////////////////////////////// [AUTO-TRANSLATED:884055ec] // //////////////////////////////rtsp相关//////////////////////////////////