1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-14 12:21:55 +00:00

RTC: Fix video and audio track pt_ is not change in player before publisher. v5.0.207 (#3925)

For WebRTC:
when player before publisher, it will happen track pt didn't change.

 - At source change step, change track pt

---------

Co-authored-by: mingche.tsai <w41203208.work@gmail.com>
Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
john 2024-02-05 15:17:32 +08:00
parent 96a8d17573
commit ba150beb0f
3 changed files with 20 additions and 1 deletions

View file

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v5-changes"></a>
## SRS 5.0 Changelog
* v5.0, 2024-02-05, Merge [#3925](https://github.com/ossrs/srs/pull/3925): RTC: Fix video and audio track pt_ is not change in player before publisher. v5.0.207 (#3925)
* v5.0, 2024-02-05, Merge [#3923](https://github.com/ossrs/srs/pull/3923): Configure: print enabled/disable sanitizer. v5.0.206 (#3923)
* v5.0, 2023-12-30, Merge [#3916](https://github.com/ossrs/srs/pull/3916): Enhancing the compatibility of options.sh. v5.0.204 (#3916)
* v5.0, 2023-12-14, Merge [#3910](https://github.com/ossrs/srs/pull/3910): RTC: Support OPUS stereo SDP option. v5.0.203 (#3910)

View file

@ -533,6 +533,15 @@ void SrsRtcPlayStream::on_stream_change(SrsRtcSourceDescription* desc)
uint32_t ssrc = desc->audio_track_desc_->ssrc_;
SrsRtcAudioSendTrack* track = audio_tracks_.begin()->second;
if (track->track_desc_->media_->pt_of_publisher_ != desc->audio_track_desc_->media_->pt_) {
track->track_desc_->media_->pt_of_publisher_ = desc->audio_track_desc_->media_->pt_;
}
if (desc->audio_track_desc_->red_ && track->track_desc_->red_ &&
track->track_desc_->red_->pt_of_publisher_ != desc->audio_track_desc_->red_->pt_) {
track->track_desc_->red_->pt_of_publisher_ = desc->audio_track_desc_->red_->pt_;
}
audio_tracks_.clear();
audio_tracks_.insert(make_pair(ssrc, track));
}
@ -546,6 +555,15 @@ void SrsRtcPlayStream::on_stream_change(SrsRtcSourceDescription* desc)
uint32_t ssrc = vdesc->ssrc_;
SrsRtcVideoSendTrack* track = video_tracks_.begin()->second;
if (track->track_desc_->media_->pt_of_publisher_ != vdesc->media_->pt_) {
track->track_desc_->media_->pt_of_publisher_ = vdesc->media_->pt_;
}
if (vdesc->red_ && track->track_desc_->red_ &&
track->track_desc_->red_->pt_of_publisher_ != vdesc->red_->pt_) {
track->track_desc_->red_->pt_of_publisher_ = vdesc->red_->pt_;
}
video_tracks_.clear();
video_tracks_.insert(make_pair(ssrc, track));
}

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 206
#define VERSION_REVISION 207
#endif