Error out if MPEG-4 part 2 compression is selected but native MPEG-4 mode isn't.

This commit is contained in:
Moritz Bunkus 2005-10-18 11:58:44 +00:00
parent 2496ee620d
commit 670f5d12db
2 changed files with 13 additions and 5 deletions

View File

@ -20,6 +20,7 @@
#include "commonebml.h"
#include "compression.h"
#include "hacks.h"
using namespace libmatroska;
@ -314,6 +315,17 @@ header_removal_compressor_c::set_track_headers(KaxContentEncoding
SetBuffer(m_bytes->get(), m_bytes->get_size());
}
mpeg4_p2_compressor_c::mpeg4_p2_compressor_c() {
if (!hack_engaged(ENGAGE_NATIVE_MPEG4))
mxerror("The MPEG-4 part 2 compression only works with native MPEG-4. "
"However, native MPEG-4 mode has not been selected with "
"'--engage native_mpeg4'.\n");
memory_cptr bytes(new memory_c((unsigned char *)safemalloc(4), 4, true));
put_uint32_be(bytes->get(), 0x000001b6);
set_bytes(bytes);
}
// ---------------------------------------------------------------------
compressor_c::~compressor_c() {

View File

@ -142,11 +142,7 @@ public:
class MTX_DLL_API mpeg4_p2_compressor_c: public header_removal_compressor_c {
public:
mpeg4_p2_compressor_c() {
memory_cptr bytes(new memory_c((unsigned char *)safemalloc(4), 4, true));
put_uint32_be(bytes->get(), 0x000001b6);
set_bytes(bytes);
}
mpeg4_p2_compressor_c();
};
// ------------------------------------------------------------------