- seq = (buf[2] << 8) | buf[3]; + seq = AV_RB16(buf + 2); Why have you changed all the indexes from [] to +. [] are preferred because they avoid compiler warnings and are easier to read IMHO. - mark