1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refine SrsFragment.duration in time unit.

This commit is contained in:
winlin 2019-04-12 08:04:06 +08:00
parent 0879bef9b2
commit bc1189caee
8 changed files with 109 additions and 29 deletions

View file

@ -335,7 +335,7 @@ srs_error_t SrsDashController::on_audio(SrsSharedPtrMessage* shared_audio, SrsFo
return refresh_init_mp4(shared_audio, format);
}
if (acurrent->duration() >= int64_t(srsu2ms(fragment))) {
if (acurrent->duration() >= fragment) {
if ((err = acurrent->reap(audio_dts)) != srs_success) {
return srs_error_wrap(err, "reap current");
}
@ -367,7 +367,7 @@ srs_error_t SrsDashController::on_video(SrsSharedPtrMessage* shared_video, SrsFo
return refresh_init_mp4(shared_video, format);
}
bool reopen = format->video->frame_type == SrsVideoAvcFrameTypeKeyFrame && vcurrent->duration() >= int64_t(srsu2ms(fragment));
bool reopen = format->video->frame_type == SrsVideoAvcFrameTypeKeyFrame && vcurrent->duration() >= fragment;
if (reopen) {
if ((err = vcurrent->reap(video_dts)) != srs_success) {
return srs_error_wrap(err, "reap current");