mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
use atc for ingest hls aac time.
This commit is contained in:
parent
a28eec89b0
commit
c514a4ceeb
1 changed files with 6 additions and 4 deletions
|
@ -657,7 +657,7 @@ public:
|
||||||
SrsIngestSrsOutput(SrsHttpUri* rtmp) {
|
SrsIngestSrsOutput(SrsHttpUri* rtmp) {
|
||||||
out_rtmp = rtmp;
|
out_rtmp = rtmp;
|
||||||
disconnected = false;
|
disconnected = false;
|
||||||
raw_aac_dts = 0;
|
raw_aac_dts = srs_update_system_time_ms();
|
||||||
|
|
||||||
req = NULL;
|
req = NULL;
|
||||||
io = NULL;
|
io = NULL;
|
||||||
|
@ -807,12 +807,14 @@ int SrsIngestSrsOutput::do_on_aac_frame(SrsStream* avs, double duration)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
u_int32_t duration_ms = (u_int32_t)(duration * 1000);
|
||||||
|
|
||||||
// ts tbn to flv tbn.
|
// ts tbn to flv tbn.
|
||||||
u_int32_t dts = (u_int32_t)raw_aac_dts;
|
u_int32_t dts = (u_int32_t)raw_aac_dts;
|
||||||
raw_aac_dts += (int64_t)(duration * 1000);
|
raw_aac_dts += duration_ms;
|
||||||
|
|
||||||
// got the next msg to calc the delta duration for each audio.
|
// got the next msg to calc the delta duration for each audio.
|
||||||
u_int32_t max_dts = dts + (u_int32_t)(duration * 1000);
|
u_int32_t max_dts = dts + duration_ms;
|
||||||
|
|
||||||
// send each frame.
|
// send each frame.
|
||||||
while (!avs->empty()) {
|
while (!avs->empty()) {
|
||||||
|
@ -852,7 +854,7 @@ int SrsIngestSrsOutput::do_on_aac_frame(SrsStream* avs, double duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// calc the delta of dts, when previous frame output.
|
// calc the delta of dts, when previous frame output.
|
||||||
u_int32_t delta = (duration * 1000) / (avs->size() / frame_size);
|
u_int32_t delta = duration_ms / (avs->size() / frame_size);
|
||||||
dts = (u_int32_t)(srs_min(max_dts, dts + delta));
|
dts = (u_int32_t)(srs_min(max_dts, dts + delta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue