merge: determine pixel dimensions for VC-1 in MPEG transport stream for verbose info

This commit is contained in:
Moritz Bunkus 2015-09-17 21:56:11 +02:00
parent c6a376cda2
commit f160324250
3 changed files with 23 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2015-09-17 Moritz Bunkus <moritz@bunkus.org>
* 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.

View File

@ -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<vc1::es_parser_c>();
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

View File

@ -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<M2VParser> m_m2v_parser;
std::shared_ptr<vc1::es_parser_c> m_vc1_parser;
unsigned int skip_packet_data_bytes;