nixpkgs/pkgs/development/libraries/mp4v2/A02-meaningful-4gb-warning.patch
Wout Mertens d1ebc1a2b3 mp4v2: Add patches from Handbrake project
mp4v2 seems abandoned upstream.

Patches:
- A00: Add API call for subpicture subtitles
- A01: Fix divide by zero
- A02: Give a meaningfull error when hitting 4GB limit
- P00: Fix compilation with mingw32
2014-05-04 01:56:48 +02:00

15 lines
730 B
Diff

diff -Naur mp4v2-trunk-r355/src/mp4atom.cpp mp4v2-trunk-r355/src/mp4atom.cpp
--- mp4v2-trunk-r355/src/mp4atom.cpp 2012-02-21 19:40:03.000000000 +0100
+++ mp4v2-trunk-r355/src/mp4atom.cpp 2012-02-21 19:36:38.000000000 +0100
@@ -543,6 +543,10 @@
m_pFile->SetPosition(m_start + 8);
m_pFile->WriteUInt64(m_size);
} else {
+ if (!(m_size <= (uint64_t)0xFFFFFFFF)) {
+ // Let the user know what the following assert is all about
+ fprintf(stderr, "MP4ERROR: File size exceeded 4 GB; output unplayable. Enable \"Large file size\" to fix it.\n");
+ }
ASSERT(m_size <= (uint64_t)0xFFFFFFFF);
m_pFile->SetPosition(m_start);
m_pFile->WriteUInt32(m_size);