mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-23 19:31:44 +00:00
Fixed AVC extraction. Patch by Mike Matsnev <mike () po ! cs ! msu !su>.
This commit is contained in:
parent
5833f47656
commit
f86057e18d
@ -55,14 +55,24 @@ xtr_avc_c::create_file(xtr_base_c *_master,
|
||||
mxerror("Track %lld with the CodecID '%s' is missing the \"codec private"
|
||||
"\" element and cannot be extracted.\n", tid, codec_id.c_str());
|
||||
|
||||
if (priv->GetSize() < 6)
|
||||
mxerror("Track %lld CodecPrivate is too small.\n", tid);
|
||||
|
||||
binary *buf = priv->GetBuffer();
|
||||
nal_size_size = 1 + (buf[4] & 3);
|
||||
|
||||
int pos = 6;
|
||||
while (priv->GetSize() > pos) {
|
||||
int i, pos = 6, numsps = buf[5] & 0x1f, numpps;
|
||||
|
||||
for (i = 0; (i < numsps) && (priv->GetSize() > pos); ++i)
|
||||
write_nal(buf, pos, priv->GetSize(), 2);
|
||||
|
||||
if (priv->GetSize() <= pos)
|
||||
return;
|
||||
|
||||
numpps = buf[pos++];
|
||||
|
||||
for (i = 0; (i < numpps) && (priv->GetSize() > pos); ++i)
|
||||
write_nal(buf, pos, priv->GetSize(), 2);
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user