From f160324250d48be46daaac48c8a5281ab2f3c382 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 17 Sep 2015 21:56:11 +0200 Subject: [PATCH] merge: determine pixel dimensions for VC-1 in MPEG transport stream for verbose info --- ChangeLog | 3 +++ src/input/r_mpeg_ts.cpp | 16 +++++++++++++++- src/input/r_mpeg_ts.h | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index af40846f4..4889fc75e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-09-17 Moritz Bunkus + * mkvmerge: bug fix: the pixel dimensions reported for VC-1 in + MPEG transport streams in verbose identification mode was 0x0. + * mkvmerge: bug fix: the number of channels and the sample rate reported for DTS in MPEG transport streams and MPEG program streams in verbose identification mode was 0. diff --git a/src/input/r_mpeg_ts.cpp b/src/input/r_mpeg_ts.cpp index 27a036466..0fabbf2dc 100644 --- a/src/input/r_mpeg_ts.cpp +++ b/src/input/r_mpeg_ts.cpp @@ -219,7 +219,21 @@ mpeg_ts_track_c::new_stream_v_hevc() { int mpeg_ts_track_c::new_stream_v_vc1() { - return 0 == pes_payload->get_size() ? FILE_STATUS_MOREDATA : 0; + if (!m_vc1_parser) + m_vc1_parser = std::make_shared(); + + m_vc1_parser->add_bytes(pes_payload->get_buffer(), pes_payload->get_size()); + + if (!m_vc1_parser->is_sequence_header_available()) + return FILE_STATUS_MOREDATA; + + auto seqhdr = vc1::sequence_header_t{}; + m_vc1_parser->get_sequence_header(seqhdr); + + v_width = seqhdr.pixel_width; + v_height = seqhdr.pixel_height; + + return 0; } int diff --git a/src/input/r_mpeg_ts.h b/src/input/r_mpeg_ts.h index 2ee886590..9ed63445f 100644 --- a/src/input/r_mpeg_ts.h +++ b/src/input/r_mpeg_ts.h @@ -30,6 +30,10 @@ #include "merge/generic_reader.h" #include "mpegparser/M2VParser.h" +namespace vc1 { +class es_parser_c; +} + enum mpeg_ts_pid_type_e { PAT_TYPE = 0, PMT_TYPE = 1, @@ -307,6 +311,7 @@ public: mtx::hevc::es_parser_cptr m_hevc_parser; truehd_parser_cptr m_truehd_parser; std::shared_ptr m_m2v_parser; + std::shared_ptr m_vc1_parser; unsigned int skip_packet_data_bytes;