From aa56576b0e780bf609e9cfcbc27e36575204c4b9 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sat, 30 Nov 2024 10:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E9=9F=B3?= =?UTF-8?q?=E9=A2=91=E5=8F=82=E6=95=B0=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ext-codec/G711.cpp | 2 +- src/Extension/Factory.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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相关//////////////////////////////////