diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2012-03-25 08:37:54 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2012-03-25 08:37:54 +0400 |
commit | accca2dc0b55cbab1ca0d0088754ee85f3434792 (patch) | |
tree | 525c97c708b209fe2d2fc63450c4590def140760 /src/filters/parser/MP4Splitter/AP4 | |
parent | 7ef0f642cafc76c5c6c41761267f8cfbcf740c20 (diff) |
Fix : MP4Splitter correct read Ctts & Stts atom with negative value;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4185 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/AP4')
-rw-r--r-- | src/filters/parser/MP4Splitter/AP4/Core/Ap4CttsAtom.cpp | 5 | ||||
-rw-r--r-- | src/filters/parser/MP4Splitter/AP4/Core/Ap4SttsAtom.cpp | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4CttsAtom.cpp b/src/filters/parser/MP4Splitter/AP4/Core/Ap4CttsAtom.cpp index 5cbdf17a0..aab0b4255 100644 --- a/src/filters/parser/MP4Splitter/AP4/Core/Ap4CttsAtom.cpp +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4CttsAtom.cpp @@ -47,6 +47,11 @@ AP4_CttsAtom::AP4_CttsAtom(AP4_Size size, AP4_ByteStream& stream) : AP4_UI32 sample_offset;
if (stream.ReadUI32(sample_count) == AP4_SUCCESS &&
stream.ReadUI32(sample_offset) == AP4_SUCCESS) {
+// mpc-hc custom code start
+ if((int)sample_offset < 0) {
+ sample_offset = 0;
+ }
+// mpc-hc custom code end
m_Entries.Append(AP4_CttsTableEntry(sample_count,
sample_offset));
}
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4SttsAtom.cpp b/src/filters/parser/MP4Splitter/AP4/Core/Ap4SttsAtom.cpp index 666207113..5eff46eac 100644 --- a/src/filters/parser/MP4Splitter/AP4/Core/Ap4SttsAtom.cpp +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4SttsAtom.cpp @@ -55,6 +55,11 @@ AP4_SttsAtom::AP4_SttsAtom(AP4_Size size, AP4_ByteStream& stream) : AP4_UI32 sample_duration;
if (stream.ReadUI32(sample_count) == AP4_SUCCESS &&
stream.ReadUI32(sample_duration) == AP4_SUCCESS) {
+// mpc-hc custom code start
+ if((int)sample_duration < 0) {
+ sample_duration = 0;
+ }
+// mpc-hc custom code end
m_Entries.Append(AP4_SttsTableEntry(sample_count,
sample_duration));
}
@@ -76,7 +81,7 @@ AP4_SttsAtom::GetDts(AP4_Ordinal sample, AP4_TimeStamp& dts, AP4_Duration& durat // check if we have the correct entry
if (sample_count_in_entry <= entry.m_SampleCount) {
dts += (sample_count_in_entry - 1) * entry.m_SampleDuration;
- duration = entry.m_SampleDuration;
+ duration = entry.m_SampleDuration;
return AP4_SUCCESS;
} else {
dts += entry.m_SampleCount * entry.m_SampleDuration;
|