From 8e10873a44cb1a4296b0ca162b295f7be8fea5a3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 16 Jan 2005 10:13:20 +0000 Subject: [PATCH] Handle TrackMinCache automatically. --- src/merge/pr_generic.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/merge/pr_generic.cpp b/src/merge/pr_generic.cpp index 3404d117d..6c1e85775 100644 --- a/src/merge/pr_generic.cpp +++ b/src/merge/pr_generic.cpp @@ -239,7 +239,7 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *nreader, hserialno = create_track_number(reader, ti->id); huid = 0; htrack_type = -1; - htrack_min_cache = -1; + htrack_min_cache = 0; htrack_max_cache = -1; hcodec_id = ""; @@ -936,6 +936,14 @@ generic_packetizer_c::add_packet2(packet_t *pack) { if (pack->fref >= 0) pack->fref += correction_timecode_offset + append_timecode_offset; + if ((htrack_min_cache < 2) && (pack->fref >= 0)) { + set_track_min_cache(2); + rerender_track_headers(); + } else if ((htrack_min_cache < 1) && (pack->bref >= 0)) { + set_track_min_cache(1); + rerender_track_headers(); + } + if (pack->timecode < 0) { delete pack; return;