                 window = nalu.readUnsignedInt();
                 // Match four-byte startcodes
                 if((window & 0xFFFFFFFF) == 0x01) {
-                    if(unit_start) {
+                  // push previous NAL unit if new start delimiter found, dont push unit with type = 0
+                    if(unit_start && unit_type) {
                         units.push({
                             length: nalu.position - 4 - unit_start,
                             start: unit_start,


        /** H264 NAL unit names. **/
        public static const NAMES:Array = [
            'Unspecified',
            'NDR',
            'Partition A',
            'Partition B',
            'Partition C',
            'IDR',
            'SEI',
            'SPS',
            'PPS',
            'AUD',
            'End of Sequence',
            'End of Stream',
            'Filler Data'
        ];
        /** H264 profiles. **/
        public static const PROFILES:Object = {

                    if(unit_type == 1 || unit_type == 5) { break; }
                // Match three-byte startcodes
                } else if((window & 0xFFFFFF00) == 0x100) {
                    // push previous NAL unit if new start delimiter found, dont push unit with type = 0
                    if(unit_start && unit_type) {
                        units.push({
                            header: unit_header,
                            length: nalu.position - 4 - unit_start,
