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

Fix start and end time bug

This commit is contained in:
winlin 2019-04-12 10:00:39 +08:00
parent 9b91c10e52
commit 41d1e91540

View file

@ -274,7 +274,7 @@ srs_error_t SrsMessageQueue::enqueue(SrsSharedPtrMessage* msg, bool* is_overflow
av_start_time = srs_utime_t(msg->timestamp * SRS_UTIME_MILLISECONDS); av_start_time = srs_utime_t(msg->timestamp * SRS_UTIME_MILLISECONDS);
} }
av_end_time = msg->timestamp; av_end_time = srs_utime_t(msg->timestamp * SRS_UTIME_MILLISECONDS);
} }
msgs.push_back(msg); msgs.push_back(msg);
@ -375,11 +375,11 @@ void SrsMessageQueue::shrink()
av_start_time = av_end_time; av_start_time = av_end_time;
//push_back secquence header and update timestamp //push_back secquence header and update timestamp
if (video_sh) { if (video_sh) {
video_sh->timestamp = av_end_time; video_sh->timestamp = srsu2ms(av_end_time);
msgs.push_back(video_sh); msgs.push_back(video_sh);
} }
if (audio_sh) { if (audio_sh) {
audio_sh->timestamp = av_end_time; audio_sh->timestamp = srsu2ms(av_end_time);
msgs.push_back(audio_sh); msgs.push_back(audio_sh);
} }