From 10f931c703c68b4fc856e09788dfe64579252bb8 Mon Sep 17 00:00:00 2001 From: peak3d Date: Thu, 22 Jul 2021 10:48:36 +0200 Subject: [PATCH] Dazn sample duration workaround Signed-off-by: Bernd Kuhls --- Source/C++/Core/Ap4TrunAtom.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/C++/Core/Ap4TrunAtom.cpp b/Source/C++/Core/Ap4TrunAtom.cpp index c51f21d..77b7c6d 100644 --- a/Source/C++/Core/Ap4TrunAtom.cpp +++ b/Source/C++/Core/Ap4TrunAtom.cpp @@ -128,6 +128,12 @@ AP4_TrunAtom::AP4_TrunAtom(AP4_UI32 size, for (unsigned int i=0; i 1 sequences + if (i && m_Entries[i].sample_duration == 1 && m_Entries[i - 1].sample_duration > 1) + { + m_Entries[i].sample_duration = m_Entries[i - 1].sample_duration >> 1; + m_Entries[i - 1].sample_duration -= m_Entries[i].sample_duration; + } --record_fields_count; } if (flags & AP4_TRUN_FLAG_SAMPLE_SIZE_PRESENT) { -- 2.30.2