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

Fix #1051, Drop ts when republishing stream. 3.0.41

This commit is contained in:
winlin 2018-08-25 18:10:55 +08:00
parent 1e054d2bcc
commit e73e30de3a
3 changed files with 4 additions and 1 deletions

View file

@ -1102,6 +1102,7 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
// Use the diff to guess whether the samples is 1024 or 960.
int nb_samples_per_frame = 1024;
int diff = ::abs((int)(audio->timestamp - previous_audio_dts)) * srs_flv_srates[format->acodec->sound_rate];
previous_audio_dts = audio->timestamp;
if (diff > 100 && diff < 950) {
nb_samples_per_frame = 960;
}