Skip to content

Commit

Permalink
Bridger: Fix build fail if disable rtc and ffmpeg-fit
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed May 1, 2021
1 parent 3d22597 commit 8a30cc8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_rtc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ srs_error_t SrsAudioTranscoder::init_enc(SrsAudioCodecId dst_codec, int dst_chan
enc_->channel_layout = av_get_default_channel_layout(dst_channels);
enc_->bit_rate = dst_bit_rate;
enc_->sample_fmt = codec->sample_fmts[0];
enc_->time_base = {1, 1000};
enc_->time_base.num = 1; enc_->time_base.den = 1000; // {1, 1000}
if (dst_codec == SrsAudioCodecIdOpus) {
//TODO: for more level setting
enc_->compression_level = 1;
Expand Down
2 changes: 2 additions & 0 deletions trunk/src/app/srs_app_rtc_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ srs_error_t SrsRtcPublishStream::initialize(SrsRequest* r, SrsRtcStreamDescripti
source->set_publish_stream(this);

// Bridge to rtmp
#if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT)
bool rtc_to_rtmp = _srs_config->get_rtc_to_rtmp(req->vhost);
if (rtc_to_rtmp) {
SrsSource *rtmp = NULL;
Expand All @@ -1019,6 +1020,7 @@ srs_error_t SrsRtcPublishStream::initialize(SrsRequest* r, SrsRtcStreamDescripti

source->set_bridger(bridger);
}
#endif

return err;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_rtmp_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsSource* source)
}

// Bridge to RTC streaming.
#ifdef SRS_RTC
#if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT)
if (rtc) {
SrsRtcFromRtmpBridger *bridger = new SrsRtcFromRtmpBridger(rtc);
if ((err = bridger->initialize(req)) != srs_success) {
Expand Down

0 comments on commit 8a30cc8

Please sign in to comment.