Rename i_original_channels to i_chan_mode. For now, chan modes can be
DOLBYSTEREO or DUALMONO.
This new value, i_chan_mode, should only be set by demuxes/codecs/packetizers
if there is a special stereo mode to handle.
Tracks matching the two introduced statements are invalid, but we still played
them fine prior to the refactoring (perhaps intentionally).
In order to stay somewhat back-compatible with earlier versions the two cases
are now added back (since there are actual files in the wild with the invalid
spec).
refs #4250
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The correct helper-function is named fill_extra_data_alac, and not
fill_extra_data. The errournous usage seems to have been introduced during the
big refactoring of the demuxer.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
As can be read in the MKV specification, a cluster must include a
timecode element in order to be valid.
These changes make sure that we error if such element is missing,
effectivelly preventing us from calling KaxCluster::GlobalTimecode
(which will assert if KaxCluster::InitTimecode has not been called).
fixes#17572
Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Parsing a cluster can fail for a number of different reasons, though
previously it was impossible for the callee to know whether parsing
was successful or not.
These changes changes the signature of
matroska_segment_c::ParseCluster so that it returns a boolean (true on
success, false on failure).
Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
matroska_segment_c::i_duration defaults to having a value of "-1", and
we should of course not try to convert the duration from the unit
within an mkv to ours _unless_ we have initialized it (through the
value of a KaxDuration).
These changes fixes that.
Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
The previous implementation caused leakage of the data-member in
question due to missing clean-up. The manual memory management is now
replaced by std::string.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
If we do not insert the given track into our maps of tracks, we would
previously not invoke es_format_Clean on the given fmt, which of
course would leak dynamically allocated members.
There was also an issue with assigning values to data-members that
would later be overwritten, of course directly causing dynamically
allocated data to be leaked.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
i_number is an unsigned int, meaning that the format-specifier should be
"%u" and not "%d"; this patch fixes that.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Make use of _seeker in matroska_segment_c::ParseCluster, as well as
making the code a little bit more readable by using more descriptive
variable names.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This patch simply utilizes the new functionality introduced in
matroska_segment_seeker.{hpp,cpp} to store seekpoints found during
playback/preloading.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
A few more lines, but far easier to read; and we should definitely
prefer maintainability instead of striving for just as few LOCs as
possible.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Managing the tracks by a std::vector has been replaced with a std::map
mapping the track-number to a mkv_track_t.
This patch includes changing BlockFindTrackIndex to FindTrackByBlock,
keeping the same behaviour though using a more accurate name for the new
code.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Minor transformation from being a plain-old-data entity to a "proper"
C++ class where manual memory management has been removed and replaced
with std::string, as well as removal of unused members.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>