Added a new hack (--engage write_headers_twice) for writing the SegmentInfo and Tracks headers a second time directly after the clusters. Those will be indexed as well.

This commit is contained in:
Moritz Bunkus 2005-05-29 09:53:37 +00:00
parent 1ec08e1c28
commit 03adf4296b
3 changed files with 16 additions and 0 deletions

View File

@ -37,6 +37,7 @@ static const char *mosu_hacks[] = {
ENGAGE_NO_DEFAULT_HEADER_VALUES, ENGAGE_NO_DEFAULT_HEADER_VALUES,
ENGAGE_FORCE_PASSTHROUGH_PACKETIZER, ENGAGE_FORCE_PASSTHROUGH_PACKETIZER,
ENGAGE_AVC_USE_BFRAMES, ENGAGE_AVC_USE_BFRAMES,
ENGAGE_WRITE_HEADERS_TWICE,
NULL NULL
}; };
static vector<string> engaged_hacks; static vector<string> engaged_hacks;

View File

@ -34,6 +34,7 @@ using namespace std;
#define ENGAGE_NO_DEFAULT_HEADER_VALUES "no_default_header_values" #define ENGAGE_NO_DEFAULT_HEADER_VALUES "no_default_header_values"
#define ENGAGE_FORCE_PASSTHROUGH_PACKETIZER "force_passthrough_packetizer" #define ENGAGE_FORCE_PASSTHROUGH_PACKETIZER "force_passthrough_packetizer"
#define ENGAGE_AVC_USE_BFRAMES "avc_use_bframes" #define ENGAGE_AVC_USE_BFRAMES "avc_use_bframes"
#define ENGAGE_WRITE_HEADERS_TWICE "write_headers_twice"
void MTX_DLL_API engage_hacks(const string &hacks); void MTX_DLL_API engage_hacks(const string &hacks);
bool MTX_DLL_API hack_engaged(const string &hack); bool MTX_DLL_API hack_engaged(const string &hack);

View File

@ -1441,6 +1441,14 @@ finish_file(bool last_file) {
mxinfo("\n"); mxinfo("\n");
// Render the track headers a second time if the user has requested that.
if (hack_engaged(ENGAGE_WRITE_HEADERS_TWICE)) {
EbmlElement *second_tracks = kax_tracks.Clone();
second_tracks->Render(*out);
kax_sh_main->IndexThis(*second_tracks, *kax_segment);
delete second_tracks;
}
// Render the cues. // Render the cues.
if (write_cues && cue_writing_requested) { if (write_cues && cue_writing_requested) {
if (verbose >= 1) if (verbose >= 1)
@ -1503,6 +1511,12 @@ finish_file(bool last_file) {
} }
out->restore_pos(); out->restore_pos();
// Render the segment info a second time if the user has requested that.
if (hack_engaged(ENGAGE_WRITE_HEADERS_TWICE)) {
kax_infos->Render(*out);
kax_sh_main->IndexThis(*kax_infos, *kax_segment);
}
// Select the chapters that lie in this file and render them in the space // Select the chapters that lie in this file and render them in the space
// that was resesrved at the beginning. // that was resesrved at the beginning.
if (kax_chapters != NULL) { if (kax_chapters != NULL) {