srs icon indicating copy to clipboard operation
srs copied to clipboard

MP4: The first sample count has a problem in SrsMp4SampleManager::write_track

Open JalySN opened this issue 4 years ago • 2 comments

    if (stts) {
        if (previous) {
            uint32_t delta = (uint32_t)(sample->dts - previous->dts);
            if (stts_entry.sample_delta == 0 || stts_entry.sample_delta == delta) {
                stts_entry.sample_delta = delta;
                stts_entry.sample_count++;
            } else {
                stts_entries.push_back(stts_entry);
                stts_entry.sample_count = 1;
                stts_entry.sample_delta = delta;
            }
        } else {
            // The first sample always in the STTS table.

stts_entry.sample_count++; // Does this line still need to be incremented here if it has already been done in the subsequent if (previous) statement? } }

TRANS_BY_GPT3

JalySN avatar Oct 11 '21 08:10 JalySN

What problems will it cause? I can't remember specifically if it's necessary or not.

TRANS_BY_GPT3

winlinvip avatar Oct 11 '21 15:10 winlinvip

Need more analysis. So much time has passed that it's as hard as possible for me to reminder.

winlinvip avatar Apr 26 '24 23:04 winlinvip