Fix H264 decoding artifacts when a frame has fewer than 3 bytes of padding at the end

This commit is contained in:
Cameron Gutman 2014-01-11 14:27:46 -05:00
parent 421d73b28a
commit 6a695d2c72

View File

@ -107,6 +107,15 @@ public class VideoDepacketizer {
{
ByteBufferDescriptor location = packet.getNewPayloadDescriptor();
if (location.length == 968) {
if (packet.getPacketIndex() < packet.getTotalPackets()) {
location.length = packet.getPayloadLength();
}
else {
return;
}
}
while (location.length != 0)
{
// Remember the start of the NAL data in this packet