Reassemble AVC NALs when padding is reached, rather than waiting through several packets until the next AVC frame start NAL. Improves video latency and vulnerability to packet loss.

This commit is contained in:
Cameron Gutman 2013-11-17 16:50:45 -05:00
parent 10165f3166
commit cca7df6c25

View File

@ -168,9 +168,16 @@ public class AvVideoDepacketizer {
}
else
{
// Not either sequence we want
// Check if this is padding after a full AVC frame
if (currentlyDecoding == AvDecodeUnit.TYPE_H264 &&
NAL.isPadding(specialSeq)) {
// The decode unit is complete
reassembleAvcNal();
}
// Not decoding AVC
currentlyDecoding = AvDecodeUnit.TYPE_UNKNOWN;
// Just skip this byte
location.length--;
location.offset++;