AC-3 frames are also possible as a result of the parser. This is
especially true for non-TrueHD streams as those don't have a strong
signature.
The reader's main code relies on a real TrueHD header having been found,
though.
Fixes#1559.
Each page has an ID when it's stored in the model. This ID used to be
the position in the list. This was fine as long as the list wasn't
dynamic. However, with the new attachment editing features the user can
add and remove attachments in arbitrary order. This means that the
position inside the list changes but not the ID associated with the
page.
Therefore a hash is now used instead with a sequential number as the ID.
The page was removed from the view and deleted, but it wasn't removed
from the model's internal list of pages. Therefore the it got deleted a
second time upon model reset leading to a segfault.
There's really no need to use the generic parent type. Using the
template argument's type instead allows one to wrap the result into
shared pointers as in e.g.
KaxAttachedPtr
createAttachment() {
// …
return {
mtx::construct::cons<KaxAttached>(new KaxFile, …)
};
}
The old logic was so complex (even within parse_start_unit_packet()
there were two or three places were data was sent to the packetizer)
that it had to be simplified a lot. The new logic knows only three
cases:
1. When parsing a normal packet then data is sent to the packetizer if
and only if the expected PES size is known (!= 0) and the accumulated
PES data's size equals the expected PES size.
2. When parsing a "start unit" packet then there are two cases:
2.a. If the previous unit's expected PES size is unknown ( == 0) then
all data gathered so far is sent to the packetizer.
2.b. Otherwise (the expected PES size is known) the packet must be too
short or too large. Otherwise it would have been sent to the
packetizer in case 1. already.
On top the packet's data is cleared in both "send_to_packetizer()" and
in "probe_packet_complete()", the two functions that handle complete
packets in the muxing phase ("send_to_packetizer()") respectively
probing phase ("probe_packet_complete()").
Fixes#1553.
Instead make determination based on number of slice start codes
found. Also move the MPEG ES probing further down to the other ES video
types (AVC, HEVC) as all of those tend to produce a lot of false
positives.
Fixes#1462.