Refuse to append AVC/h.264 video tracks that do not have matching codec private blocks. Invalidates Anthill bug #163.

This commit is contained in:
Moritz Bunkus 2005-11-16 21:50:58 +00:00
parent affa49e62f
commit ccb05d396f
3 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-11-16 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: mkvmerge will now refuse to append AVC/h.264
video tracks whose codec initialization data blocks do not
match. Invalidates Anthill bug #163.
2005-11-12 Moritz Bunkus <moritz@bunkus.org> 2005-11-12 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Fixed a crash If the granulepos (the * mkvmerge: bug fix: Fixed a crash If the granulepos (the

View File

@ -779,3 +779,28 @@ mpeg4_p10_video_packetizer_c::process(packet_cptr packet) {
return FILE_STATUS_MOREDATA; return FILE_STATUS_MOREDATA;
} }
connection_result_e
mpeg4_p10_video_packetizer_c::can_connect_to(generic_packetizer_c *src,
string &error_message) {
connection_result_e result;
mpeg4_p10_video_packetizer_c *vsrc;
vsrc = dynamic_cast<mpeg4_p10_video_packetizer_c *>(src);
if (NULL == vsrc)
return CAN_CONNECT_NO_FORMAT;
result = video_packetizer_c::can_connect_to(src, error_message);
if (CAN_CONNECT_YES != result)
return result;
if ((NULL != ti.private_data) &&
memcmp(ti.private_data, vsrc->ti.private_data, ti.private_size)) {
error_message = mxsprintf("The codec's private data does not match."
"Both have the same length (%d) but different "
"content.", ti.private_size);
return CAN_CONNECT_NO_PARAMETERS;
}
return CAN_CONNECT_YES;
}

View File

@ -108,6 +108,9 @@ public:
track_info_c &_ti); track_info_c &_ti);
virtual int process(packet_cptr packet); virtual int process(packet_cptr packet);
virtual connection_result_e can_connect_to(generic_packetizer_c *src,
string &error_message);
protected: protected:
virtual void extract_aspect_ratio(); virtual void extract_aspect_ratio();
}; };